Kaydet (Commit) 60cdeb2d authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#88583 MSWordExportBase: fix handling of paragraph background color

Regression from 7d9bb549 (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
üst 4b9a9ce8
...@@ -629,6 +629,13 @@ DECLARE_OOXMLEXPORT_TEST(testEffectExtentMargin, "effectextent-margin.docx") ...@@ -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")); 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(); CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -304,6 +304,14 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool ...@@ -304,6 +304,14 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool
(nWhich >= XATTR_FILL_FIRST && nWhich < XATTR_FILL_LAST)) (nWhich >= XATTR_FILL_FIRST && nWhich < XATTR_FILL_LAST))
AttrOutput().OutputItem( *pItem ); 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 pISet = 0; // fuer Doppel-Attribute
} }
......
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