sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 4 ++++ sw/qa/extras/ww8export/data/tdf127862_pageFillStyle.odt |binary sw/qa/extras/ww8export/ww8export3.cxx | 12 +++++++++++- sw/source/filter/ww8/ww8par.cxx | 8 ++++++-- 4 files changed, 21 insertions(+), 3 deletions(-)
New commits: commit b02252f1c8213bb0a01086c6eb58e3fdb957d6ad Author: Justin Luth <justin_l...@sil.org> AuthorDate: Tue Oct 1 10:02:20 2019 +0300 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Wed Oct 2 15:56:34 2019 +0200 tdf#127862 ww8import: page style - import XATTR if defined ...which fixes losing the background color of the page. That was broken by LO63 commit cc899c6967238877f0094bcf00627145e484ffec since an obsolete RES_BACKGROUND was not necessarily created. Change-Id: I944a1b3f3df1468c283f93a49ffacfbd223fb392 Reviewed-on: https://gerrit.libreoffice.org/79912 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_l...@sil.org> Reviewed-by: Michael Stahl <michael.st...@cib.de> (cherry picked from commit e3c1be1149440fdcfea452aadce0a523af83fe5a) Reviewed-on: https://gerrit.libreoffice.org/80016 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 01824b36e8ac..ac0cd45112fb 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -755,6 +755,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf38778, "tdf38778_properties_in_run_for_field.doc // w:fldCharType="end" assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[7]/w:rPr/w:sz", "val", psz); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[7]/w:rPr/w:szCs", "val", pszCs); + + // tdf#127862: page fill color (in this case white) was lost + uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT(drawing::FillStyle_NONE != getProperty<drawing::FillStyle>(xStyle, "FillStyle")); } DECLARE_OOXMLEXPORT_TEST(testFDO76312, "FDO76312.docx") diff --git a/sw/qa/extras/ww8export/data/tdf127862_pageFillStyle.odt b/sw/qa/extras/ww8export/data/tdf127862_pageFillStyle.odt new file mode 100644 index 000000000000..c382c9aa6735 Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf127862_pageFillStyle.odt differ diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index a143a2ea6310..eaba6ba3ae6f 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -44,7 +44,11 @@ DECLARE_WW8EXPORT_TEST(testTdf37778_readonlySection, "tdf37778_readonlySection.d // The problem was that section protection was being enabled in addition to being read-only. // This created an explicit section with protection. There should be just the default, non-explicit section. CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of Sections", sal_Int32(0), xSections->getCount()); - } + + // tdf#127862: page fill color (in this case white) was lost + uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT(drawing::FillStyle_NONE != getProperty<drawing::FillStyle>(xStyle, "FillStyle")); +} DECLARE_WW8EXPORT_TEST(testTdf122429_header, "tdf122429_header.doc") { @@ -211,6 +215,12 @@ DECLARE_WW8EXPORT_TEST(testTdf123433_fillStyleStop, "tdf123433_fillStyleStop.doc CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty<sal_uInt32>(xText, "ParaBackColor"))); } +DECLARE_WW8EXPORT_TEST(testTdf127862_pageFillStyle, "tdf127862_pageFillStyle.odt") +{ + uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT(drawing::FillStyle_NONE != getProperty<drawing::FillStyle>(xStyle, "FillStyle")); +} + DECLARE_WW8EXPORT_TEST(testTdf94009_zeroPgMargin, "tdf94009_zeroPgMargin.odt") { uno::Reference<beans::XPropertySet> defaultStyle(getStyles("PageStyles")->getByName("Standard"), diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 1baf02989eb1..e294fb97e59f 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4355,10 +4355,14 @@ void wwSectionManager::SetSegmentToPageDesc(const wwSection &rSection, // Only handle shape if it is a background shape if (aData.begin()->get()->nFlags & ShapeFlag::Background) { - SfxItemSet aSet(rFormat.GetAttrSet()); + SfxItemSet aSet(rFormat.GetDoc()->GetAttrPool(), + svl::Items<RES_BACKGROUND, RES_BACKGROUND,XATTR_START, XATTR_END>{}); mrReader.MatchSdrItemsIntoFlySet(pObject, aSet, mso_lineSimple, mso_lineSolid, mso_sptRectangle, aRect); - rFormat.SetFormatAttr(aSet.Get(RES_BACKGROUND)); + if ( aSet.HasItem(RES_BACKGROUND) ) + rFormat.SetFormatAttr(aSet.Get(RES_BACKGROUND)); + else + rFormat.SetFormatAttr(aSet); } } SdrObject::Free(pObject); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits