oox/source/export/drawingml.cxx     |    6 ++++++
 sd/qa/unit/data/pptx/tdf137675.pptx |binary
 sd/qa/unit/export-tests-ooxml1.cxx  |   14 ++++++++++++++
 3 files changed, 20 insertions(+)

New commits:
commit 59b16fdf4e25db134ed52457c857eae5241a75e5
Author:     Tibor Nagy <nagy.tib...@nisz.hu>
AuthorDate: Tue Jan 4 14:38:47 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Feb 3 10:04:46 2022 +0100

    tdf#137675 PPTX export: adding missing fill="none" to a:path
    
    Follow-up to commit 9310e47e2ce71348a16e5412131946348833f4b2
    "tdf#101122 DOCX custom shape export: remove bad fill".
    
    Change-Id: I2acdae3964c31ee366387d9938fe366405dcace9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127944
    Tested-by: Jenkins
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 22b66d4083d34cbce2b7b48daeed3152bf9877b7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129330
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 4731f556967e..e1062795e3ae 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -3712,9 +3712,14 @@ bool DrawingML::WriteCustomGeometry(
                                       XML_r, "r", XML_b, "b");
                 mpFS->startElementNS(XML_a, XML_pathLst);
 
+                std::optional<OString> sFill;
+                if (HasEnhancedCustomShapeSegmentCommand(rXShape, 
css::drawing::EnhancedCustomShapeSegmentCommand::NOFILL))
+                    sFill = "none"; // for possible values see ST_PathFillMode 
in OOXML standard
+
                 if ( aPathSize.hasElements() )
                 {
                     mpFS->startElementNS( XML_a, XML_path,
+                          XML_fill, sFill,
                           XML_w, OString::number(aPathSize[0].Width),
                           XML_h, OString::number(aPathSize[0].Height) );
                 }
@@ -3741,6 +3746,7 @@ bool DrawingML::WriteCustomGeometry(
                             nYMax = nY;
                     }
                     mpFS->startElementNS( XML_a, XML_path,
+                          XML_fill, sFill,
                           XML_w, OString::number(nXMax - nXMin),
                           XML_h, OString::number(nYMax - nYMin) );
                 }
diff --git a/sd/qa/unit/data/pptx/tdf137675.pptx 
b/sd/qa/unit/data/pptx/tdf137675.pptx
new file mode 100644
index 000000000000..d4d767aa5246
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf137675.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 3b50dcf0b793..16c50457e846 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -126,6 +126,7 @@ public:
     void testTdf143126();
     void testTdf143129();
     void testTdf118045();
+    void testTdf137675();
 
     CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
@@ -194,6 +195,7 @@ public:
     CPPUNIT_TEST(testTdf143126);
     CPPUNIT_TEST(testTdf143129);
     CPPUNIT_TEST(testTdf118045);
+    CPPUNIT_TEST(testTdf137675);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -1762,6 +1764,18 @@ void SdOOXMLExportTest1::testTdf118045()
                 "110000");
 }
 
+void SdOOXMLExportTest1::testTdf137675()
+{
+    sd::DrawDocShellRef xDocShRef
+        = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf137675.pptx"), 
PPTX);
+    utl::TempFile tempFile;
+    xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+    xDocShRef->DoClose();
+
+    xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
+    assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", "fill", 
"none");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1);
 
 CPPUNIT_PLUGIN_IMPLEMENT();

Reply via email to