[Libreoffice-commits] core.git: include/vcl svtools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Feb 20 21:08:56 UTC 2019


 include/vcl/wall.hxx             |    7 +++++++
 svtools/source/contnr/ivctrl.cxx |    3 +--
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 0f3b53a1219eac898152f64dee1c1ff2809846b0
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Feb 20 15:10:25 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Feb 20 22:08:32 2019 +0100

    extract empty test as method
    
    Change-Id: If383e2f1542ffb57415f8138077013dbafa0fc69
    Reviewed-on: https://gerrit.libreoffice.org/68095
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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() );
     }


More information about the Libreoffice-commits mailing list