Kaydet (Commit) 0f3b53a1 authored tarafından Caolán McNamara's avatar Caolán McNamara

extract empty test as method

Change-Id: If383e2f1542ffb57415f8138077013dbafa0fc69
Reviewed-on: https://gerrit.libreoffice.org/68095
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 6bcb9e1c
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#ifndef INCLUDED_VCL_WALL_HXX #ifndef INCLUDED_VCL_WALL_HXX
#define INCLUDED_VCL_WALL_HXX #define INCLUDED_VCL_WALL_HXX
#include <tools/color.hxx>
#include <tools/gen.hxx> #include <tools/gen.hxx>
#include <vcl/dllapi.h> #include <vcl/dllapi.h>
#include <o3tl/cow_wrapper.hxx> #include <o3tl/cow_wrapper.hxx>
...@@ -98,6 +99,12 @@ public: ...@@ -98,6 +99,12 @@ public:
bool operator!=( const Wallpaper& rWallpaper ) const bool operator!=( const Wallpaper& rWallpaper ) const
{ return !(Wallpaper::operator==( rWallpaper )); } { return !(Wallpaper::operator==( rWallpaper )); }
bool IsEmpty() const
{
return GetStyle() == WallpaperStyle::NONE && GetColor() == COL_TRANSPARENT &&
!IsBitmap() && !IsGradient() && !IsRect();
}
friend VCL_DLLPUBLIC SvStream& ReadWallpaper( SvStream& rIStm, Wallpaper& rWallpaper ); friend VCL_DLLPUBLIC SvStream& ReadWallpaper( SvStream& rIStm, Wallpaper& rWallpaper );
friend VCL_DLLPUBLIC SvStream& WriteWallpaper( SvStream& rOStm, const Wallpaper& rWallpaper ); friend VCL_DLLPUBLIC SvStream& WriteWallpaper( SvStream& rOStm, const Wallpaper& rWallpaper );
}; };
......
...@@ -327,8 +327,7 @@ void SvtIconChoiceCtrl::SetBackground( const Wallpaper& rPaper ) ...@@ -327,8 +327,7 @@ void SvtIconChoiceCtrl::SetBackground( const Wallpaper& rPaper )
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
// if it is the default (empty) wallpaper // if it is the default (empty) wallpaper
if( rPaper.GetStyle() == WallpaperStyle::NONE && rPaper.GetColor() == COL_TRANSPARENT && if (rPaper.IsEmpty())
!rPaper.IsBitmap() && !rPaper.IsGradient() && !rPaper.IsRect())
{ {
Control::SetBackground( rStyleSettings.GetFieldColor() ); Control::SetBackground( rStyleSettings.GetFieldColor() );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment