Blame SOURCES/0001-strip-off-hard-coded-numbering-from-outliner-preview.patch

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