summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-02-20 15:10:25 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-02-20 22:08:32 +0100
commit0f3b53a1219eac898152f64dee1c1ff2809846b0 (patch)
tree5f6457a5cae0b0d6a37eb451bfd03925854e6b96
parent6bcb9e1c4ea98dd4e154670495c7f0a2a8ffc0d2 (diff)
extract empty test as method
Change-Id: If383e2f1542ffb57415f8138077013dbafa0fc69 Reviewed-on: https://gerrit.libreoffice.org/68095 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/vcl/wall.hxx7
-rw-r--r--svtools/source/contnr/ivctrl.cxx3
2 files changed, 8 insertions, 2 deletions
diff --git a/include/vcl/wall.hxx b/include/vcl/wall.hxx
index c68bbf31ac10..fd5100860cb3 100644
--- a/include/vcl/wall.hxx
+++ b/include/vcl/wall.hxx
@@ -20,6 +20,7 @@
#ifndef INCLUDED_VCL_WALL_HXX
#define INCLUDED_VCL_WALL_HXX
+#include <tools/color.hxx>
#include <tools/gen.hxx>
#include <vcl/dllapi.h>
#include <o3tl/cow_wrapper.hxx>
@@ -98,6 +99,12 @@ public:
bool operator!=( const Wallpaper& rWallpaper ) const
{ 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& WriteWallpaper( SvStream& rOStm, const Wallpaper& rWallpaper );
};
diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx
index c178f6fcd01d..cbcacd1242dc 100644
--- a/svtools/source/contnr/ivctrl.cxx
+++ b/svtools/source/contnr/ivctrl.cxx
@@ -327,8 +327,7 @@ void SvtIconChoiceCtrl::SetBackground( const Wallpaper& rPaper )
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
// if it is the default (empty) wallpaper
- if( rPaper.GetStyle() == WallpaperStyle::NONE && rPaper.GetColor() == COL_TRANSPARENT &&
- !rPaper.IsBitmap() && !rPaper.IsGradient() && !rPaper.IsRect())
+ if (rPaper.IsEmpty())
{
Control::SetBackground( rStyleSettings.GetFieldColor() );
}