[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - include/vcl vcl/headless vcl/source

Michael Meeks michael.meeks at collabora.com
Thu Nov 16 13:03:19 UTC 2017


 include/vcl/settings.hxx    |    4 ++++
 vcl/headless/svpframe.cxx   |    8 +++++++-
 vcl/source/app/settings.cxx |   13 +++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)

New commits:
commit 07ee9335d0be1a2bfe2d39bd5b9fd3fef715e3dd
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Nov 10 17:57:19 2017 +0000

    vcl: StyleSettings - start to unwind code duplication.
    
    This should be a pure re-factor, plus headless tweak.
    
    Change-Id: Iad7f524ea76625601b3f85cc13a50311ed1de171
    Reviewed-on: https://gerrit.libreoffice.org/44811
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index e8b7c0a6f28a..ffa39ad7c1c5 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -605,6 +605,10 @@ public:
 
     bool                            operator ==( const StyleSettings& rSet ) const;
     bool                            operator !=( const StyleSettings& rSet ) const;
+
+    // Batch setters used by various backends
+    void                            BatchSetBackgrounds( const Color &aBackColor,
+                                                         bool bCheckedColorSpecialCase = true);
 };
 
 
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 0ce76cf119d1..6db9d3b2e350 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -409,8 +409,14 @@ LanguageType SvpSalFrame::GetInputLanguage()
     return LANGUAGE_DONTKNOW;
 }
 
-void SvpSalFrame::UpdateSettings( AllSettings& )
+void SvpSalFrame::UpdateSettings( AllSettings& rSettings )
 {
+    StyleSettings aStyleSettings = rSettings.GetStyleSettings();
+
+    Color aBackgroundColor( 0xec, 0xec, 0xec );
+    aStyleSettings.BatchSetBackgrounds( aBackgroundColor, false );
+
+    rSettings.SetStyleSettings( aStyleSettings );
 }
 
 void SvpSalFrame::Beep()
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index e4d90f91e253..69848d3f530c 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -3112,4 +3112,17 @@ AllSettings::GetSysLocale()
     return mxData->maSysLocale;
 }
 
+
+void StyleSettings::BatchSetBackgrounds( const Color &aBackColor,
+                                         bool bCheckedColorSpecialCase )
+{
+    Set3DColors( aBackColor );
+    SetFaceColor( aBackColor );
+    SetDialogColor( aBackColor );
+    SetWorkspaceColor( aBackColor );
+
+    if (bCheckedColorSpecialCase)
+        SetCheckedColorSpecialCase();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list