Kaydet (Commit) 210f42a3 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

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
üst 9827eaea
...@@ -6634,5 +6634,16 @@ ...@@ -6634,5 +6634,16 @@
</prop> </prop>
</group> </group>
</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> </component>
</oor:component-schema> </oor:component-schema>
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/theUICommandDescription.hpp> #include <com/sun/star/frame/theUICommandDescription.hpp>
#include <officecfg/Office/Common.hxx>
#include <sfx2/sfxhelp.hxx> #include <sfx2/sfxhelp.hxx>
#include <sfx2/app.hxx> #include <sfx2/app.hxx>
...@@ -515,8 +516,11 @@ StyleTreeListBox_Impl::StyleTreeListBox_Impl(SfxCommonTemplateDialog_Impl* pPare ...@@ -515,8 +516,11 @@ StyleTreeListBox_Impl::StyleTreeListBox_Impl(SfxCommonTemplateDialog_Impl* pPare
void StyleTreeListBox_Impl::Recalc() void StyleTreeListBox_Impl::Recalc()
{ {
if (officecfg::Office::Common::StylesAndFormatting::Preview::get())
{
SetEntryHeight(32 * GetDPIScaleFactor()); SetEntryHeight(32 * GetDPIScaleFactor());
RecalcViewData(); RecalcViewData();
}
} }
/** Internal structure for the establishment of the hierarchical view */ /** Internal structure for the establishment of the hierarchical view */
...@@ -627,9 +631,11 @@ SvTreeListEntry* FillBox_Impl(SvTreeListBox* pBox, ...@@ -627,9 +631,11 @@ SvTreeListEntry* FillBox_Impl(SvTreeListBox* pBox,
{ {
SvTreeListEntry* pTreeListEntry = pBox->InsertEntry(pEntry->getName(), pParent); SvTreeListEntry* pTreeListEntry = pBox->InsertEntry(pEntry->getName(), pParent);
if (officecfg::Office::Common::StylesAndFormatting::Preview::get())
{
StyleLBoxString* pStyleLBoxString = new StyleLBoxString(pTreeListEntry, 0, pEntry->getName(), eStyleFamily); StyleLBoxString* pStyleLBoxString = new StyleLBoxString(pTreeListEntry, 0, pEntry->getName(), eStyleFamily);
pTreeListEntry->ReplaceItem(pStyleLBoxString, 1); pTreeListEntry->ReplaceItem(pStyleLBoxString, 1);
}
pBox->GetModel()->InvalidateEntry(pTreeListEntry); pBox->GetModel()->InvalidateEntry(pTreeListEntry);
...@@ -1245,8 +1251,11 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) ...@@ -1245,8 +1251,11 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
for(nPos = 0; nPos < nCount; ++nPos) for(nPos = 0; nPos < nCount; ++nPos)
{ {
SvTreeListEntry* pTreeListEntry = aFmtLb->InsertEntry(aStrings[nPos], 0, false, nPos); SvTreeListEntry* pTreeListEntry = aFmtLb->InsertEntry(aStrings[nPos], 0, false, nPos);
if (officecfg::Office::Common::StylesAndFormatting::Preview::get())
{
StyleLBoxString* pStyleLBoxString = new StyleLBoxString(pTreeListEntry, 0, aStrings[nPos], eFam); StyleLBoxString* pStyleLBoxString = new StyleLBoxString(pTreeListEntry, 0, aStrings[nPos], eFam);
pTreeListEntry->ReplaceItem(pStyleLBoxString, 1); pTreeListEntry->ReplaceItem(pStyleLBoxString, 1);
}
aFmtLb->GetModel()->InvalidateEntry(pTreeListEntry); aFmtLb->GetModel()->InvalidateEntry(pTreeListEntry);
} }
aFmtLb->Recalc(); aFmtLb->Recalc();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment