summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-07-14 14:19:23 +0900
committerAndras Timar <andras.timar@collabora.com>2015-08-06 12:56:35 +0200
commit263d42425177f7e6515373ff6c4fd78bda66a278 (patch)
treea2aa391e8800938d88c1afc32b6c09d21f7c4221 /sfx2/source/dialog
parent39c36caddb8b5acd2aed8caa3a6df9173ac7f514 (diff)
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/17177 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r--sfx2/source/dialog/templdlg.cxx23
1 files changed, 16 insertions, 7 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 722b6c808df2..d99a5e41c142 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();