[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-0' - officecfg/registry sfx2/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Tue Jul 21 23:05:48 PDT 2015


 officecfg/registry/schema/org/openoffice/Office/Common.xcs |   13 ++++++-
 sfx2/source/dialog/templdlg.cxx                            |   23 +++++++++----
 2 files changed, 28 insertions(+), 8 deletions(-)

New commits:
commit 5e42fa59ff1e4f46c05b1c438dd3757dbb7a14d6
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Jul 14 14:19:23 2015 +0900

    tdf#91495 add property to turn off stlye previews
    
    Newly added property Office::Common::StylesAndFormatting::Preview
    can now be used to turn off "Style And Formatting" style preview.
    
    Change-Id: I2e01de2a74e2d295557c87022a7b745ce23b4800
    (cherry picked from commit 210f42a318cbac62de835ccacbc1fc0e36f713f6)
    Reviewed-on: https://gerrit.libreoffice.org/17179
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 6f0dcb7..730c712 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2162,7 +2162,7 @@
           <!-- UIHints: Tools  Options - General  Save - [Section] Save -->
           <info>
             <desc>Specifies whether to generate a thumbnail image and place it inside the
-	      the odf archive file, which makes it possible to see a preview of the document.</desc>
+            the odf archive file, which makes it possible to see a preview of the document.</desc>
             <label>Store a preview of this document</label>
           </info>
           <value>true</value>
@@ -6626,5 +6626,16 @@
         </prop>
       </group>
     </group>
+    <group oor:name="StylesAndFormatting">
+      <info>
+        <desc>Contains settings for Styles and Formatting.</desc>
+      </info>
+      <prop oor:name="Preview" oor:type="xs:boolean" oor:nillable="false">
+        <info>
+           <desc>Specifies if the styles and formatting preview is enabled.</desc>
+        </info>
+        <value>true</value>
+      </prop>
+    </group>
   </component>
 </oor:component-schema>
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 722b6c8..d99a5e4 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/frame/ModuleManager.hpp>
 #include <com/sun/star/frame/theUICommandDescription.hpp>
+#include <officecfg/Office/Common.hxx>
 
 #include <sfx2/sfxhelp.hxx>
 #include <sfx2/app.hxx>
@@ -526,8 +527,11 @@ StyleTreeListBox_Impl::StyleTreeListBox_Impl(SfxCommonTemplateDialog_Impl* pPare
 
 void StyleTreeListBox_Impl::Recalc()
 {
-    SetEntryHeight(32 * GetDPIScaleFactor());
-    RecalcViewData();
+    if (officecfg::Office::Common::StylesAndFormatting::Preview::get())
+    {
+        SetEntryHeight(32 * GetDPIScaleFactor());
+        RecalcViewData();
+    }
 }
 
 /** Internal structure for the establishment of the hierarchical view */
@@ -638,9 +642,11 @@ SvTreeListEntry* FillBox_Impl(SvTreeListBox* pBox,
 {
     SvTreeListEntry* pTreeListEntry = pBox->InsertEntry(pEntry->getName(), pParent);
 
-    StyleLBoxString* pStyleLBoxString = new StyleLBoxString(pTreeListEntry, 0, pEntry->getName(), eStyleFamily);
-
-    pTreeListEntry->ReplaceItem(pStyleLBoxString, 1);
+    if (officecfg::Office::Common::StylesAndFormatting::Preview::get())
+    {
+        StyleLBoxString* pStyleLBoxString = new StyleLBoxString(pTreeListEntry, 0, pEntry->getName(), eStyleFamily);
+        pTreeListEntry->ReplaceItem(pStyleLBoxString, 1);
+    }
 
     pBox->GetModel()->InvalidateEntry(pTreeListEntry);
 
@@ -1242,8 +1248,11 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
                 for(nPos = 0; nPos < nCount; ++nPos)
                 {
                     SvTreeListEntry* pTreeListEntry = aFmtLb->InsertEntry(aStrings[nPos], 0, false, nPos);
-                    StyleLBoxString* pStyleLBoxString = new StyleLBoxString(pTreeListEntry, 0, aStrings[nPos], eFam);
-                    pTreeListEntry->ReplaceItem(pStyleLBoxString, 1);
+                    if (officecfg::Office::Common::StylesAndFormatting::Preview::get())
+                    {
+                        StyleLBoxString* pStyleLBoxString = new StyleLBoxString(pTreeListEntry, 0, aStrings[nPos], eFam);
+                        pTreeListEntry->ReplaceItem(pStyleLBoxString, 1);
+                    }
                     aFmtLb->GetModel()->InvalidateEntry(pTreeListEntry);
                 }
                 aFmtLb->Recalc();


More information about the Libreoffice-commits mailing list