[Libreoffice-commits] core.git: sw/qa sw/source

Miklos Vajna vmiklos at collabora.co.uk
Sat Jan 31 01:58:19 PST 2015


 sw/qa/extras/ooxmlexport/data/tdf88583.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx   |    7 +++++++
 sw/source/filter/ww8/ww8atr.cxx            |    8 ++++++++
 3 files changed, 15 insertions(+)

New commits:
commit 60cdeb2d441a6bf5c55f511f574b2b9dd598fbb8
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Jan 31 10:55:39 2015 +0100

    tdf#88583 MSWordExportBase: fix handling of paragraph background color
    
    Regression from 7d9bb549d498d6beed2c4050c402d09643febdfa (Related:
    i#124638 Second step of DrawingLayer FillAttributes..., 2014-06-02), the
    problem was that exporters still expect an SvxBrushItem for the para
    background color, while doc model was changed to have an XFillStyleItem
    / XFillColorItem pair instead.
    
    Change-Id: Ib94fda103ec35a6f087307aafdd890183d9d935f

diff --git a/sw/qa/extras/ooxmlexport/data/tdf88583.odt b/sw/qa/extras/ooxmlexport/data/tdf88583.odt
new file mode 100644
index 0000000..307ab1e
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf88583.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 2109a7f..53a0b7e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -629,6 +629,13 @@ DECLARE_OOXMLEXPORT_TEST(testEffectExtentMargin, "effectextent-margin.docx")
     CPPUNIT_ASSERT_EQUAL(oox::drawingml::convertEmuToHmm(114300+95250), getProperty<sal_Int32>(getShape(1), "LeftMargin"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf88583, "tdf88583.odt")
+{
+    if (xmlDocPtr pXmlDoc = parseExport())
+        // <w:pPr> had no <w:shd> child element, paragraph background was lost.
+        assertXPath(pXmlDoc, "//w:pPr/w:shd", "fill", "00CC00");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 1a80623..9ef456e 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -304,6 +304,14 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool
                      (nWhich >= XATTR_FILL_FIRST && nWhich < XATTR_FILL_LAST))
                     AttrOutput().OutputItem( *pItem );
             }
+
+            // Has to be called after RES_PARATR_GRABBAG is processed.
+            const XFillStyleItem* pXFillStyleItem(static_cast<const XFillStyleItem*>(rSet.GetItem(XATTR_FILLSTYLE)));
+            if (pXFillStyleItem && pXFillStyleItem->GetValue() == drawing::FillStyle_SOLID && !rSet.HasItem(RES_BACKGROUND))
+            {
+                // Construct an SvxBrushItem, as expected by the exporters.
+                AttrOutput().OutputItem(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND));
+            }
         }
         pISet = 0;                      // fuer Doppel-Attribute
     }


More information about the Libreoffice-commits mailing list