[Libreoffice-commits] core.git: 2 commits - include/svtools include/vcl officecfg/registry sc/inc sc/source sc/uiconfig svtools/source svx/source vcl/source

Caolán McNamara caolanm at redhat.com
Tue Jun 18 08:47:01 PDT 2013


 include/svtools/accessibilityoptions.hxx                   |    5 
 include/vcl/settings.hxx                                   |    6 -
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |   13 ++
 sc/inc/globstr.hrc                                         |   11 --
 sc/inc/sc.hrc                                              |    4 
 sc/source/ui/inc/tpusrlst.hxx                              |   10 +
 sc/source/ui/optdlg/tpusrlst.cxx                           |   69 +++++++++----
 sc/source/ui/src/globstr.src                               |    4 
 sc/source/ui/src/scstring.src                              |   10 -
 sc/uiconfig/scalc/ui/optsortlists.ui                       |   44 +++++++-
 svtools/source/config/accessibilityoptions.cxx             |   57 ++++++++++
 svx/source/dialog/dlgctrl.cxx                              |   21 +++
 svx/source/gallery2/galctrl.cxx                            |    2 
 svx/source/tbxctrls/fontworkgallery.cxx                    |    2 
 svx/source/xoutdev/xtabdash.cxx                            |    2 
 svx/source/xoutdev/xtabhtch.cxx                            |    2 
 svx/source/xoutdev/xtablend.cxx                            |    2 
 vcl/source/app/settings.cxx                                |    6 -
 18 files changed, 209 insertions(+), 61 deletions(-)

New commits:
commit d1dda534fbf27e107937c8acff594be3d6ba6810
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 18 16:35:24 2013 +0100

    use sizegroups and shown/hidden buttons to stop ui jitter
    
    i.e. duplicate the buttons rather than change their content and have the same
    handlers for both variants.  Hide the one we don't want at any given time and
    use size-groups to get the same width regardless of the combination shown. All
    so the ui doesn't jump around the place as the button content changes.
    
    Change-Id: Icca938a6381da1feaf43fd11779d1d6d94d5d3a0

diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 41b6c47..f9fda26 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -673,13 +673,12 @@
 
 #define STR_FUN_TEXT_SELECTION_COUNT    546
 
-#define STR_DISMISS                 547
-#define STR_QUERYREMOVE             548
-#define STR_COPYLIST                549
-#define STR_COPYFROM                550
-#define STR_COPYERR                 551
+#define STR_QUERYREMOVE             547
+#define STR_COPYLIST                548
+#define STR_COPYFROM                549
+#define STR_COPYERR                 550
 
-#define STR_COUNT                   552
+#define STR_COUNT                   551
 
 #endif
 
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 8579644..a5d6973 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -718,10 +718,10 @@
 #define SCSTR_COLUMN            (STR_START + 13)
 #define SCSTR_ROW               (STR_START + 14)
 #define SCSTR_NEW               (STR_START + 15)
-#define SCSTR_ADD               (STR_START + 16)
+
 #define SCSTR_REMOVE            (STR_START + 17)
 #define SCSTR_CANCEL            (STR_START + 18)
-#define SCSTR_MODIFY            (STR_START + 19)
+
 #define SCSTR_SHOWTABLE         (STR_START + 20)
 #define SCSTR_HIDDENTABLES      (STR_START + 21)
 
diff --git a/sc/source/ui/inc/tpusrlst.hxx b/sc/source/ui/inc/tpusrlst.hxx
index 331c1a40..08b92cb 100644
--- a/sc/source/ui/inc/tpusrlst.hxx
+++ b/sc/source/ui/inc/tpusrlst.hxx
@@ -54,16 +54,18 @@ private:
     VclMultiLineEdit*   mpEdEntries;
     FixedText*          mpFtCopyFrom;
     Edit*               mpEdCopyFrom;
+
     PushButton*         mpBtnNew;
+    PushButton*         mpBtnDiscard;
+
     PushButton*         mpBtnAdd;
+    PushButton*         mpBtnModify;
+
     PushButton*         mpBtnRemove;
+
     PushButton*         mpBtnCopy;
 
     const String    aStrQueryRemove;
-    String          aStrNew;
-    const String    aStrCancel;
-    const String    aStrAdd;
-    const String    aStrModify;
     const String    aStrCopyList;
     const String    aStrCopyFrom;
     const String    aStrCopyErr;
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index b0e92ca..ad86994 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -58,9 +58,6 @@ ScTpUserLists::ScTpUserLists( Window*               pParent,
                           "OptSortLists", "modules/scalc/ui/optsortlists.ui",
                           rCoreAttrs ),
         aStrQueryRemove ( ScGlobal::GetRscString( STR_QUERYREMOVE ) ),
-        aStrCancel      ( ScGlobal::GetRscString( STR_DISMISS ) ),
-        aStrAdd         ( ScResId( SCSTR_ADD ) ),
-        aStrModify      ( ScResId( SCSTR_MODIFY ) ),
         aStrCopyList    ( ScGlobal::GetRscString( STR_COPYLIST ) ),
         aStrCopyFrom    ( ScGlobal::GetRscString( STR_COPYFROM ) ),
         aStrCopyErr     ( ScGlobal::GetRscString( STR_COPYERR ) ),
@@ -81,12 +78,12 @@ ScTpUserLists::ScTpUserLists( Window*               pParent,
     get(mpFtCopyFrom, "copyfromlabel");
     get(mpEdCopyFrom, "copyfrom");
     get(mpBtnNew, "new");
+    get(mpBtnDiscard, "discard");
     get(mpBtnAdd, "add");
+    get(mpBtnModify, "modify");
     get(mpBtnRemove, "delete");
     get(mpBtnCopy, "copy");
 
-    aStrNew = mpBtnNew->GetText();
-
     SetExchangeSupport();
     Init();
     Reset(rCoreAttrs);
@@ -109,8 +106,9 @@ void ScTpUserLists::Init()
 
     mpLbLists->SetSelectHdl   ( LINK( this, ScTpUserLists, LbSelectHdl ) );
     mpBtnNew->SetClickHdl     ( LINK( this, ScTpUserLists, BtnClickHdl ) );
-    mpBtnNew->SetClickHdl     ( LINK( this, ScTpUserLists, BtnClickHdl ) );
+    mpBtnDiscard->SetClickHdl ( LINK( this, ScTpUserLists, BtnClickHdl ) );
     mpBtnAdd->SetClickHdl     ( LINK( this, ScTpUserLists, BtnClickHdl ) );
+    mpBtnModify->SetClickHdl  ( LINK( this, ScTpUserLists, BtnClickHdl ) );
     mpBtnRemove->SetClickHdl  ( LINK( this, ScTpUserLists, BtnClickHdl ) );
     mpEdEntries->SetModifyHdl ( LINK( this, ScTpUserLists, EdEntriesModHdl ) );
 
@@ -192,9 +190,12 @@ void ScTpUserLists::Reset( const SfxItemSet& rCoreAttrs )
         mpBtnRemove->Disable();
     }
 
-    mpBtnNew->SetText( aStrNew );
-    mpBtnAdd->SetText( aStrAdd );
+    mpBtnNew->Show();
+    mpBtnDiscard->Hide();
+    mpBtnAdd->Show();
+    mpBtnModify->Hide();
     mpBtnAdd->Disable();
+    mpBtnModify->Disable();
 
     if ( !bCopyDone && pViewData )
     {
@@ -493,7 +494,11 @@ IMPL_LINK( ScTpUserLists, LbSelectHdl, ListBox*, pLb )
             if ( !mpFtEntries->IsEnabled() )  mpFtEntries->Enable();
             if ( !mpEdEntries->IsEnabled() )  mpEdEntries->Enable();
             if ( !mpBtnRemove->IsEnabled() )  mpBtnRemove->Enable();
-            if (  mpBtnAdd->IsEnabled() )     mpBtnAdd->Disable();
+            if ( mpBtnAdd->IsEnabled() )
+            {
+                mpBtnAdd->Disable();
+                mpBtnModify->Disable();
+            }
 
             UpdateEntries( nSelPos );
         }
@@ -506,7 +511,7 @@ IMPL_LINK( ScTpUserLists, LbSelectHdl, ListBox*, pLb )
 
 IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
 {
-    if ( pBtn == mpBtnNew )
+    if ( pBtn == mpBtnNew || pBtn == mpBtnDiscard )
     {
         if ( !bCancelMode )
         {
@@ -521,6 +526,7 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
             mpEdEntries->SetText( EMPTY_STRING );
             mpEdEntries->GrabFocus();
             mpBtnAdd->Disable();
+            mpBtnModify->Disable();
             mpBtnRemove->Disable();
             //-----------------------------
             if ( mpBtnCopy->IsEnabled() )
@@ -529,7 +535,8 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
                 mpFtCopyFrom->Disable();
                 mpEdCopyFrom->Disable();
             }
-            mpBtnNew->SetText( aStrCancel );
+            mpBtnNew->Hide();
+            mpBtnDiscard->Show();
             bCancelMode = sal_True;
         }
         else // if ( bCancelMode )
@@ -549,6 +556,7 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
                 mpBtnRemove->Disable();
             }
             mpBtnAdd->Disable();
+            mpBtnModify->Disable();
             //-----------------------------
             if ( pViewData && !bCopyDone )
             {
@@ -556,12 +564,13 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
                 mpFtCopyFrom->Enable();
                 mpEdCopyFrom->Enable();
             }
-            mpBtnNew->SetText( aStrNew );
+            mpBtnNew->Show();
+            mpBtnDiscard->Hide();
             bCancelMode = false;
             bModifyMode = false;
         }
     }
-    else if ( pBtn == mpBtnAdd )
+    else if (pBtn == mpBtnAdd || pBtn == mpBtnModify)
     {
         String theEntriesStr( mpEdEntries->GetText() );
 
@@ -588,8 +597,10 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
             }
 
             mpBtnAdd->Disable();
+            mpBtnModify->Disable();
             mpBtnRemove->Enable();
-            mpBtnNew->SetText( aStrNew );
+            mpBtnNew->Show();
+            mpBtnDiscard->Hide();
             bCancelMode = false;
         }
         else // if ( bModifyMode )
@@ -610,9 +621,14 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
                 LbSelectHdl( mpLbLists );
             }
 
-            mpBtnNew->SetText( aStrNew ); bCancelMode = false;
-            mpBtnAdd->SetText( aStrAdd ); bModifyMode = false;
+            mpBtnNew->Show();
+            mpBtnDiscard->Hide();
+            bCancelMode = false;
+            mpBtnAdd->Show();
+            mpBtnModify->Show();
             mpBtnAdd->Disable();
+            mpBtnModify->Disable();
+            bModifyMode = false;
             mpBtnRemove->Enable();
             mpFtLists->Enable();
             mpLbLists->Enable();
@@ -748,21 +764,34 @@ IMPL_LINK( ScTpUserLists, EdEntriesModHdl, VclMultiLineEdit*, pEd )
     {
         if ( !bCancelMode && !bModifyMode )
         {
-            mpBtnNew->SetText( aStrCancel );  bCancelMode = sal_True;
-            mpBtnAdd->SetText( aStrModify );  bModifyMode = sal_True;
+            mpBtnNew->Hide();
+            mpBtnDiscard->Show();
+            bCancelMode = sal_True;
+            mpBtnAdd->Hide();
             mpBtnAdd->Enable();
+            mpBtnModify->Show();
+            mpBtnModify->Enable();
+            bModifyMode = sal_True;
             mpBtnRemove->Disable();
             mpFtLists->Disable();
             mpLbLists->Disable();
         }
         else // if ( bCancelMode || bModifyMode )
         {
-            if ( !mpBtnAdd->IsEnabled() ) mpBtnAdd->Enable();
+            if ( !mpBtnAdd->IsEnabled() )
+            {
+                mpBtnAdd->Enable();
+                mpBtnModify->Enable();
+            }
         }
     }
     else
     {
-        if ( mpBtnAdd->IsEnabled() ) mpBtnAdd->Disable();
+        if ( mpBtnAdd->IsEnabled() )
+        {
+            mpBtnAdd->Disable();
+            mpBtnModify->Disable();
+        }
     }
 
     return 0;
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 759d295..af236f9 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -2065,10 +2065,6 @@ Resource RID_GLOBSTR
     {
         Text [ en-US ] = "Invalid condition." ;
     };
-    String STR_DISMISS
-    {
-        Text [ en-US ] = "~Discard" ;
-    };
     String STR_QUERYREMOVE
     {
         Text [ en-US ] = "Should the entry\n#\nbe deleted?" ;
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index 76212d3..462db0b 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -215,11 +215,6 @@ String SCSTR_NEW
     Text [ en-US ] = "~New" ;
 };
 
-String SCSTR_ADD
-{
-    Text [ en-US ] = "~Add" ;
-};
-
 String SCSTR_REMOVE
 {
     Text [ en-US ] = "~Delete" ;
@@ -230,11 +225,6 @@ String SCSTR_CANCEL
     Text [ en-US ] = "Cance~l" ;
 };
 
-String SCSTR_MODIFY
-{
-    Text [ en-US ] = "Modif~y" ;
-};
-
 String SCSTR_SHOWTABLE
 {
     Text [ en-US ] = "Show Sheet" ;
diff --git a/sc/uiconfig/scalc/ui/optsortlists.ui b/sc/uiconfig/scalc/ui/optsortlists.ui
index 34dec77..590e73a 100644
--- a/sc/uiconfig/scalc/ui/optsortlists.ui
+++ b/sc/uiconfig/scalc/ui/optsortlists.ui
@@ -35,6 +35,20 @@
               </packing>
             </child>
             <child>
+              <object class="GtkButton" id="discard">
+                <property name="label" translatable="yes">_Discard</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="no_show_all">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkButton" id="add">
                 <property name="label" translatable="yes">_Add</property>
                 <property name="visible">True</property>
@@ -45,7 +59,21 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">1</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="modify">
+                <property name="label" translatable="yes">Modif_y</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="no_show_all">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">3</property>
               </packing>
             </child>
             <child>
@@ -59,7 +87,7 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">2</property>
+                <property name="position">4</property>
               </packing>
             </child>
           </object>
@@ -213,4 +241,16 @@
       </packing>
     </child>
   </object>
+  <object class="GtkSizeGroup" id="sizegroup1">
+    <widgets>
+      <widget name="new"/>
+      <widget name="discard"/>
+    </widgets>
+  </object>
+  <object class="GtkSizeGroup" id="sizegroup2">
+    <widgets>
+      <widget name="add"/>
+      <widget name="modify"/>
+    </widgets>
+  </object>
 </interface>
commit 60446a0386b6d40899f6817c9545414841ee3522
Author: Armin Le Grand <alg at apache.org>
Date:   Tue May 7 09:37:01 2013 +0000

    Related: #i122120# corrected flag for drawing checkerboards...
    
    adapted previews, added to configuration
    
    (cherry picked from commit c17e634e125f524d153e1ad8febff6d11b810ee4)
    
    Conflicts:
    	officecfg/registry/schema/org/openoffice/Office/Common.xcs
    	svtools/inc/svtools/accessibilityoptions.hxx
    	svtools/source/inc/configitems/accessibilityoptions_const.hxx
    	vcl/inc/vcl/settings.hxx
    
    Change-Id: I3f4fd9525e31cd816599b963ecd2fa42b1f666d7

diff --git a/include/svtools/accessibilityoptions.hxx b/include/svtools/accessibilityoptions.hxx
index ccaff7e..641d6fe 100644
--- a/include/svtools/accessibilityoptions.hxx
+++ b/include/svtools/accessibilityoptions.hxx
@@ -62,6 +62,10 @@ public:
     // only be changed when the color palette is changed from the default
     sal_Int16   GetColorValueSetColumnCount() const;
 
+    // option to make previews show the content with a checkeded background to allow
+    // simple identification and better preview of transparent content
+    sal_Bool    GetPreviewUsesCheckeredBackground() const;
+
     void        SetIsForPagePreviews(sal_Bool bSet);
     void        SetIsHelpTipsDisappear(sal_Bool bSet);
     void        SetIsAllowAnimatedGraphics(sal_Bool bSet);
@@ -75,6 +79,7 @@ public:
     void        SetEdgeBlending(sal_Int16 nSet);
     void        SetListBoxMaximumLineCount(sal_Int16 nSet);
     void        SetColorValueSetColumnCount(sal_Int16 nSet);
+    void        SetPreviewUsesCheckeredBackground(sal_Bool bSet);
 
     sal_Bool                IsModified() const;
     void                    Commit();
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index 10f23d4..545bc70 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -360,7 +360,7 @@ private:
     Size                            maListBoxPreviewDefaultLogicSize;
     Size                            maListBoxPreviewDefaultPixelSize;
     sal_uInt16                      mnListBoxPreviewDefaultLineWidth;
-    sal_Bool                        mbUIPreviewUsesCheckeredBackground;
+    sal_Bool                        mbPreviewUsesCheckeredBackground;
 
     OUString                        maPersonaHeaderFooter; ///< Cache the settings to detect changes.
 
@@ -935,8 +935,8 @@ public:
 
     // defines if previews which containn potentially transparent objects (e.g. the dash/line/LineStartEnd previews and others)
     // use the default transparent visualization background (checkered background) as it has got standard in graphic programs nowadays
-    void SetUIPreviewUsesCheckeredBackground(bool bNew) { CopyData(); mpData->mbUIPreviewUsesCheckeredBackground = bNew; }
-    bool GetUIPreviewUsesCheckeredBackground() const { return mpData->mbUIPreviewUsesCheckeredBackground; }
+    void SetPreviewUsesCheckeredBackground(bool bNew) { CopyData(); mpData->mbPreviewUsesCheckeredBackground = bNew; }
+    bool GetPreviewUsesCheckeredBackground() const { return mpData->mbPreviewUsesCheckeredBackground; }
 
     void                            SetStandardStyles();
 
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index a50e335..1d64c93 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -6262,6 +6262,19 @@
         </info>
         <value>8</value>
       </prop>
+      <prop oor:name="PreviewUsesCheckeredBackground" oor:type="xs:boolean">
+        <info>
+          <author>ALG</author>
+          <desc>
+            This option allows to make previews (e.g. UI previews for object attirbutes) show the content with a checkeded 
+            background to allow simple identification and better preview of transparent content, e.g. when a draw object
+            is filled with a transparent graphic (SVG or bitmap) the preview will show the checkered background shine
+            through, so the user can identify that the fill has transparency with a single look.
+          </desc>
+          <label>Shows previews with shining through checkered background to visualize transparency.</label>
+         </info>
+         <value>false</value>
+       </prop>
     </group>
     <group oor:name="ExternalApps" oor:extensible="true">
       <info>
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index 679d7ac..6ba0a24 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -59,6 +59,7 @@ namespace
     const char s_sColorValueSetColumnCount[] = "ColorValueSetColumnCount";
     const char s_sEdgeBlending[] = "EdgeBlending";
     const char s_sListBoxMaximumLineCount[] = "ListBoxMaximumLineCount";
+    const char s_sPreviewUsesCheckeredBackground[]  = "PreviewUsesCheckeredBackground";
 }
 
 // class SvtAccessibilityOptions_Impl ---------------------------------------------
@@ -86,6 +87,7 @@ public:
     sal_Int16   GetEdgeBlending() const;
     sal_Int16   GetListBoxMaximumLineCount() const;
     sal_Int16   GetColorValueSetColumnCount() const;
+    sal_Bool    GetPreviewUsesCheckeredBackground() const;
 
     void        SetAutoDetectSystemHC(sal_Bool bSet);
     void        SetIsForPagePreviews(sal_Bool bSet);
@@ -99,6 +101,7 @@ public:
     void        SetEdgeBlending(sal_Int16 nSet);
     void        SetListBoxMaximumLineCount(sal_Int16 nSet);
     void        SetColorValueSetColumnCount(sal_Int16 nSet);
+    void        SetPreviewUsesCheckeredBackground(sal_Bool bSet);
 
     sal_Bool    IsModified() const { return bIsModified; };
 };
@@ -357,6 +360,24 @@ sal_Int16 SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() const
     return nRet;
 }
 
+sal_Bool SvtAccessibilityOptions_Impl::GetPreviewUsesCheckeredBackground() const
+{
+    css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
+    sal_Bool bRet = sal_False;
+
+    try
+    {
+        if(xNode.is())
+            xNode->getPropertyValue(s_sPreviewUsesCheckeredBackground) >>= bRet;
+    }
+    catch(const css::uno::Exception& ex)
+    {
+        SAL_WARN("svtools", "Caught unexpected: " << ex.Message);
+    }
+
+    return bRet;
+}
+
 void SvtAccessibilityOptions_Impl::SetAutoDetectSystemHC(sal_Bool bSet)
 {
     css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
@@ -583,6 +604,14 @@ void SvtAccessibilityOptions_Impl::SetVCLSettings()
         StyleSettingsChanged = true;
     }
 
+    const bool bPreviewUsesCheckeredBackground(GetPreviewUsesCheckeredBackground());
+
+    if(aStyleSettings.GetPreviewUsesCheckeredBackground() != bPreviewUsesCheckeredBackground)
+    {
+        aStyleSettings.SetPreviewUsesCheckeredBackground(bPreviewUsesCheckeredBackground);
+        StyleSettingsChanged = true;
+    }
+
     if(StyleSettingsChanged)
     {
         aAllSettings.SetStyleSettings(aStyleSettings);
@@ -652,6 +681,26 @@ void SvtAccessibilityOptions_Impl::SetColorValueSetColumnCount(sal_Int16 nSet)
     }
 }
 
+void SvtAccessibilityOptions_Impl::SetPreviewUsesCheckeredBackground(sal_Bool bSet)
+{
+    css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
+
+    try
+    {
+        if(xNode.is() && xNode->getPropertyValue(s_sPreviewUsesCheckeredBackground)!=bSet)
+        {
+            xNode->setPropertyValue(s_sPreviewUsesCheckeredBackground, css::uno::makeAny(bSet));
+            ::comphelper::ConfigurationHelper::flush(m_xCfg);
+
+            bIsModified = sal_True;
+        }
+    }
+    catch(const css::uno::Exception& ex)
+    {
+        SAL_WARN("svtools", "Caught unexpected: " << ex.Message);
+    }
+}
+
 // -----------------------------------------------------------------------
 // class SvtAccessibilityOptions --------------------------------------------------
 
@@ -756,6 +805,10 @@ sal_Int16 SvtAccessibilityOptions::GetColorValueSetColumnCount() const
 {
     return sm_pSingleImplConfig->GetColorValueSetColumnCount();
 }
+sal_Bool SvtAccessibilityOptions::GetPreviewUsesCheckeredBackground() const
+{
+    return sm_pSingleImplConfig->GetPreviewUsesCheckeredBackground();
+}
 
 // -----------------------------------------------------------------------
 void SvtAccessibilityOptions::SetAutoDetectSystemHC(sal_Bool bSet)
@@ -810,6 +863,10 @@ void SvtAccessibilityOptions::SetColorValueSetColumnCount(sal_Int16 nSet)
 {
     sm_pSingleImplConfig->SetColorValueSetColumnCount(nSet);
 }
+void SvtAccessibilityOptions::SetPreviewUsesCheckeredBackground(sal_Bool bSet)
+{
+    sm_pSingleImplConfig->SetPreviewUsesCheckeredBackground(bSet);
+}
 
 // -----------------------------------------------------------------------
 
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 18d5671..9dc7bb8 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1209,7 +1209,7 @@ namespace
             {
                 const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
 
-                if(rStyleSettings.GetUIPreviewUsesCheckeredBackground())
+                if(rStyleSettings.GetPreviewUsesCheckeredBackground())
                 {
                     const Point aNull(0, 0);
                     static const sal_uInt32 nLen(8);
@@ -1635,7 +1635,24 @@ void SvxPreviewBase::LocalPrePaint()
         mpBufferDevice->SetMapMode(GetMapMode());
     }
 
-    mpBufferDevice->Erase();
+    const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+
+    if(rStyleSettings.GetPreviewUsesCheckeredBackground())
+    {
+        const Point aNull(0, 0);
+        static const sal_uInt32 nLen(8);
+        static const Color aW(COL_WHITE);
+        static const Color aG(0xef, 0xef, 0xef);
+        const bool bWasEnabled(mpBufferDevice->IsMapModeEnabled());
+
+        mpBufferDevice->EnableMapMode(false);
+        mpBufferDevice->DrawCheckered(aNull, mpBufferDevice->GetOutputSizePixel(), nLen, aW, aG);
+        mpBufferDevice->EnableMapMode(bWasEnabled);
+    }
+    else
+    {
+        mpBufferDevice->Erase();
+    }
 }
 
 void SvxPreviewBase::LocalPostPaint()
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index 3e154f4..2aacbaa 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -262,7 +262,7 @@ void drawTransparenceBackground(OutputDevice& rOut, const Point& rPos, const Siz
 {
     const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
 
-    if(rStyleSettings.GetUIPreviewUsesCheckeredBackground())
+    if(rStyleSettings.GetPreviewUsesCheckeredBackground())
     {
         // draw checkered background
         static const sal_uInt32 nLen(8);
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 1b5cad9..d1f4104 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -130,7 +130,7 @@ void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId)
 
             aVDev.SetOutputSizePixel(aSize);
 
-            if(rStyleSettings.GetUIPreviewUsesCheckeredBackground())
+            if(rStyleSettings.GetPreviewUsesCheckeredBackground())
             {
                 static const sal_uInt32 nLen(8);
                 static const Color aW(COL_WHITE);
diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx
index 93ada53..ea9fb01 100644
--- a/svx/source/xoutdev/xtabdash.cxx
+++ b/svx/source/xoutdev/xtabdash.cxx
@@ -146,7 +146,7 @@ Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash)
         ? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT
         : DRAWMODE_DEFAULT);
 
-    if(rStyleSettings.GetUIPreviewUsesCheckeredBackground())
+    if(rStyleSettings.GetPreviewUsesCheckeredBackground())
     {
         const Point aNull(0, 0);
         static const sal_uInt32 nLen(8 * nFactor);
diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx
index 8235cab..2a1edd1 100644
--- a/svx/source/xoutdev/xtabhtch.cxx
+++ b/svx/source/xoutdev/xtabhtch.cxx
@@ -150,7 +150,7 @@ Bitmap XHatchList::CreateBitmapForUI( long nIndex )
             ? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT
             : DRAWMODE_DEFAULT);
 
-        if(rStyleSettings.GetUIPreviewUsesCheckeredBackground())
+        if(rStyleSettings.GetPreviewUsesCheckeredBackground())
         {
             const Point aNull(0, 0);
             static const sal_uInt32 nLen(8);
diff --git a/svx/source/xoutdev/xtablend.cxx b/svx/source/xoutdev/xtablend.cxx
index d5bc789..1dae9c8 100644
--- a/svx/source/xoutdev/xtablend.cxx
+++ b/svx/source/xoutdev/xtablend.cxx
@@ -131,7 +131,7 @@ Bitmap XLineEndList::CreateBitmapForUI( long nIndex )
             ? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT
             : DRAWMODE_DEFAULT);
 
-        if(rStyleSettings.GetUIPreviewUsesCheckeredBackground())
+        if(rStyleSettings.GetPreviewUsesCheckeredBackground())
         {
             const Point aNull(0, 0);
             static const sal_uInt32 nLen(8);
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 6539d38..1412071 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -243,7 +243,7 @@ ImplStyleData::ImplStyleData() :
     maListBoxPreviewDefaultLogicSize = Size(15, 7);
     maListBoxPreviewDefaultPixelSize = Size(0, 0); // on-demand calculated in GetListBoxPreviewDefaultPixelSize()
     mnListBoxPreviewDefaultLineWidth = 1;
-    mbUIPreviewUsesCheckeredBackground = true;
+    mbPreviewUsesCheckeredBackground = true;
 
     SetStandardStyles();
 }
@@ -367,7 +367,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
     maListBoxPreviewDefaultLogicSize = rData.maListBoxPreviewDefaultLogicSize;
     maListBoxPreviewDefaultPixelSize = rData.maListBoxPreviewDefaultPixelSize;
     mnListBoxPreviewDefaultLineWidth = rData.mnListBoxPreviewDefaultLineWidth;
-    mbUIPreviewUsesCheckeredBackground = rData.mbUIPreviewUsesCheckeredBackground;
+    mbPreviewUsesCheckeredBackground = rData.mbPreviewUsesCheckeredBackground;
 }
 
 // -----------------------------------------------------------------------
@@ -985,7 +985,7 @@ sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const
          (mpData->maListBoxPreviewDefaultLogicSize  == rSet.mpData->maListBoxPreviewDefaultLogicSize)   &&
          (mpData->maListBoxPreviewDefaultPixelSize  == rSet.mpData->maListBoxPreviewDefaultPixelSize)   &&
          (mpData->mnListBoxPreviewDefaultLineWidth  == rSet.mpData->mnListBoxPreviewDefaultLineWidth)   &&
-         (mpData->mbUIPreviewUsesCheckeredBackground == rSet.mpData->mbUIPreviewUsesCheckeredBackground))
+         (mpData->mbPreviewUsesCheckeredBackground == rSet.mpData->mbPreviewUsesCheckeredBackground))
         return sal_True;
     else
         return sal_False;


More information about the Libreoffice-commits mailing list