From 210f42a318cbac62de835ccacbc1fc0e36f713f6 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Tue, 14 Jul 2015 14:19:23 +0900 Subject: 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 --- sfx2/source/dialog/templdlg.cxx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'sfx2') 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 #include #include +#include #include #include @@ -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(); -- cgit