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

Michael Meeks michael.meeks at collabora.com
Mon Nov 27 09:34:01 UTC 2017


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

New commits:
commit 3c24b1fe38018d51f55f59ba877f222f49e9583d
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Sat Nov 11 12:29:26 2017 +0000

    vcl: StyleSettings - start to unwind code duplication.
    
    This should be a pure re-factor, plus:
    
        switch from Serif -> Sans font default for the UI (wow).
        enable larger font size for LOK only
            that avoids a hard to debug svx junit test failure.
    
    Change-Id: Id438026064983ea4907819bab55c4be740954605
    Reviewed-on: https://gerrit.libreoffice.org/44898
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index ffa39ad7c1c5..2c95a77d016b 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -608,7 +608,9 @@ public:
 
     // Batch setters used by various backends
     void                            BatchSetBackgrounds( const Color &aBackColor,
-                                                         bool bCheckedColorSpecialCase = true);
+                                                         bool bCheckedColorSpecialCase = true );
+    void                            BatchSetFonts( const vcl::Font& aAppFont,
+                                                   const vcl::Font& aLabelFont );
 };
 
 
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 6db9d3b2e350..db4ed6e1411a 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -18,6 +18,8 @@
  */
 
 #include <string.h>
+
+#include <comphelper/lok.hxx>
 #include <vcl/syswin.hxx>
 
 #include "headless/svpframe.hxx"
@@ -416,6 +418,15 @@ void SvpSalFrame::UpdateSettings( AllSettings& rSettings )
     Color aBackgroundColor( 0xec, 0xec, 0xec );
     aStyleSettings.BatchSetBackgrounds( aBackgroundColor, false );
 
+    if (comphelper::LibreOfficeKit::isActive()) // TODO: remove this.
+    {
+        vcl::Font aStdFont( FAMILY_SWISS, Size( 0, 14 ) );
+        aStdFont.SetCharSet( osl_getThreadTextEncoding() );
+        aStdFont.SetWeight( WEIGHT_NORMAL );
+        aStdFont.SetFamilyName( "Liberation Sans" );
+        aStyleSettings.BatchSetFonts( aStdFont, aStdFont );
+    }
+
     rSettings.SetStyleSettings( aStyleSettings );
 }
 
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 69848d3f530c..94cc2a351493 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -3125,4 +3125,21 @@ void StyleSettings::BatchSetBackgrounds( const Color &aBackColor,
         SetCheckedColorSpecialCase();
 }
 
+void StyleSettings::BatchSetFonts( const vcl::Font& aAppFont,
+                                   const vcl::Font& aLabelFont )
+{
+    SetAppFont( aAppFont );
+    SetPushButtonFont( aAppFont );
+    SetToolFont( aAppFont );
+    SetHelpFont( aAppFont );
+
+    SetMenuFont( aLabelFont );
+    SetTabFont( aLabelFont );
+    SetLabelFont( aLabelFont );
+    SetRadioCheckFont( aLabelFont );
+    SetFieldFont( aLabelFont );
+    SetGroupFont( aLabelFont );
+    SetIconFont( aLabelFont );
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list