oox/qa/unit/data/tdf163803_image_with_fill.pptx |binary oox/qa/unit/export.cxx | 16 ++++++++++++++++ oox/source/export/shapes.cxx | 1 + 3 files changed, 17 insertions(+)
New commits: commit 5ff283e3b841230a45715e48a251c3c4216d1cec Author: Jaume Pujantell <[email protected]> AuthorDate: Thu Nov 7 12:52:31 2024 +0100 Commit: Jaume Pujantell <[email protected]> CommitDate: Fri Nov 8 15:19:27 2024 +0100 tdf#163803 oox: export fill on graphic object The fill contents of a graphic object are lost when saving a pptx. Change-Id: I055d778d4a92de18dfec59bd27c63a20c08b99f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176208 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit dfd8caa6c49bd33f549a37d6c0244e4cce8f16d8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176224 Reviewed-by: Jaume Pujantell <[email protected]> Tested-by: Jenkins diff --git a/oox/qa/unit/data/tdf163803_image_with_fill.pptx b/oox/qa/unit/data/tdf163803_image_with_fill.pptx new file mode 100644 index 000000000000..db45264fb304 Binary files /dev/null and b/oox/qa/unit/data/tdf163803_image_with_fill.pptx differ diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx index aff4a634bcda..63351ae79e4b 100644 --- a/oox/qa/unit/export.cxx +++ b/oox/qa/unit/export.cxx @@ -1416,6 +1416,22 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134401_ExportAutoGrowToTextWordWrap) assertXPathNoAttribute(pXmlDoc, "//p:sp[1]/p:txBody/a:bodyPr", "wrap"); assertXPath(pXmlDoc, "//p:sp[2]/p:txBody/a:bodyPr", "wrap", u"none"); } + +CPPUNIT_TEST_FIXTURE(Test, testTdf163803_ImageFill) +{ + loadFromFile(u"tdf163803_image_with_fill.pptx"); + save(u"Impress Office Open XML"_ustr); + + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); + // Check that the fill color is saved: + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 1 + // - Actual : 0 + // - In <>, XPath '//p:pic/p:spPr/a:solidFill' number of nodes is incorrect + // i.e. the <a:solidFill> element was not written. + assertXPath(pXmlDoc, "//p:pic/p:spPr/a:solidFill"); + assertXPath(pXmlDoc, "//p:pic/p:spPr/a:solidFill/a:srgbClr", "val", u"000000"); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 5726e445a452..a2cac3d42710 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1553,6 +1553,7 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape } WriteShapeTransformation( xShape, XML_a, bFlipH, false, false, false, true ); WritePresetShape( "rect"_ostr ); + WriteFill(xShapeProps); // graphic object can come with the frame (bnc#654525) WriteOutline( xShapeProps );
