diff options
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 13 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 23 |
2 files changed, 28 insertions, 8 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 220a9896b6cf..7e722cae9e92 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -2165,7 +2165,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> @@ -6634,5 +6634,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 5b91be93f979..9446d0bf00a7 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -33,6 +33,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> @@ -515,8 +516,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 */ @@ -627,9 +631,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); @@ -1245,8 +1251,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(); |