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