You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libreoffice/0001-strip-off-hard-coded-n...

68 lines
2.7 KiB

From 0f1fc84029475565fda1bad43d99a114391afdc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Tue, 11 Nov 2014 13:33:53 +0000
Subject: [PATCH] strip off hard-coded numbering from outliner preview on load
how to reproduce an outline which won't update wrt the numbering style
file->new->presentation
view->master->slide master
select first entry of outliner, i.e. "Click to edit the outline text format"
make it underlined, save, reload
view->master->slide master
now use bullet and numbering
set level 1 to e.g. none, ok
nothing happens to the outliner. It remains "stuck" with its default numbering
Change-Id: I95708b1f1c9cc74ae5129dbfad8ca0d37b00fa13
---
sd/source/filter/xml/sdxmlwrp.cxx | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index fd8cacc..ad1cd23 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -55,6 +55,7 @@
#include <com/sun/star/io/XActiveDataControl.hpp>
#include <comphelper/genericpropertyset.hxx>
#include <comphelper/propertysetinfo.hxx>
+#include <editeng/eeitem.hxx>
#include <unotools/saveopt.hxx>
// include necessary for XML progress bar at load time
@@ -444,6 +445,7 @@ void fixupOutlinePlaceholderNumberingDepths(SdDrawDocument* pDoc)
const sal_Int32 nParaCount = pOutliner->GetParagraphCount();
for (sal_Int32 j = 0; j < nParaCount; ++j)
{
+ //Make sure the depth of the paragraph matches that of the outline style it previews
const sal_Int16 nExpectedDepth = j;
if (nExpectedDepth != pOutliner->GetDepth(j))
{
@@ -451,10 +453,21 @@ void fixupOutlinePlaceholderNumberingDepths(SdDrawDocument* pDoc)
pOutliner->SetDepth(p, nExpectedDepth);
bInconsistent = true;
}
+
+ //If the preview has hard-coded bullets/numbering then they must
+ //be stripped to reveal the true underlying styles attributes
+ SfxItemSet aAttrs(pOutliner->GetParaAttribs(j));
+ if (aAttrs.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET)
+ {
+ aAttrs.ClearItem(EE_PARA_NUMBULLET);
+ pOutliner->SetParaAttribs(j, aAttrs);
+ bInconsistent = true;
+ }
+
}
if (bInconsistent)
{
- SAL_WARN("sd.filter", "Fixing inconsistent outline numbering placeholder preview depth");
+ SAL_WARN("sd.filter", "Fixing inconsistent outline numbering placeholder preview");
pMasterOutline->SetOutlinerParaObject(pOutliner->CreateParaObject(0, nParaCount));
}
pOutliner->Clear();
--
1.9.3