From 5ff283e3b841230a45715e48a251c3c4216d1cec Mon Sep 17 00:00:00 2001 From: Jaume Pujantell Date: Thu, 7 Nov 2024 12:52:31 +0100 Subject: [PATCH] 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 Reviewed-by: Miklos Vajna (cherry picked from commit dfd8caa6c49bd33f549a37d6c0244e4cce8f16d8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176224 Reviewed-by: Jaume Pujantell Tested-by: Jenkins --- oox/qa/unit/data/tdf163803_image_with_fill.pptx | Bin 0 -> 9204 bytes oox/qa/unit/export.cxx | 16 ++++++++++++++++ oox/source/export/shapes.cxx | 1 + 3 files changed, 17 insertions(+) create mode 100644 oox/qa/unit/data/tdf163803_image_with_fill.pptx 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 0000000000000000000000000000000000000000..db45264fb3047d90126ec5d9133024ac8b4c26de GIT binary patch literal 9204 zcmaKR1y~eZ)ArIJDc#*5-6`GOAkBir(%mT`-5||^G)Q+U(xr4Gjg$yT|KRgJujv21 z&R*=b?6qfh=RR}h+%vbb927Jr03IG5K<#Rw19)VJ_pc2dfi_OeOb^fH@d|QKB1o?e zZ?Jk6T4puT;xhLof|ta1QQ_HVQNIoa%O_qQ5=G=77QlNBz2Qb3C0jhejM>Zt5ApK0 zSn68SUJ!0_@Lf5&zgV8t@7T@S3Dac&rZ=T}CPdUE&@V$_3ah-IFe_B&7E2D(mBI@c z?^u(r0?q5iW+Tlrr<#*wB>Bu}JN+=aBp@KCgH?yl4w+&+)pagZU8SWct|7a6i=X0@ zUu=e$5>nrRGtk50<=J=pOm#xez*$u`pxcGYtlixCBwKQ@w*jdJ5-|xsYu-?_6a_nb z%nwpo4h|j}R&ZthKH}$)0D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pkXQ&mZ)d#63{jUnYqAkBh$$+&`T?F3G=d tBoOZ(XMeK5KRrAy0}rM9m#q{1pM_jm4(2{%0RYtd2jl&@s{R?o{{ul#wXXmG literal 0 HcmV?d00001 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 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 );