oox/source/drawingml/presetgeometrynames.cxx  |    4 +--
 sd/qa/unit/data/pptx/ShapePlusImage.pptx      |binary
 sd/qa/unit/data/pptx/ShapeTextInflateTop.pptx |binary
 sd/qa/unit/export-tests-ooxml2.cxx            |   34 ++++++++++++++++++++++++++
 4 files changed, 36 insertions(+), 2 deletions(-)

New commits:
commit 9083ed07950d8c9f3e5f2f8bba7f07862c6433e2
Author:     Gabor Kelemen <kelemen.gab...@nisz.hu>
AuthorDate: Fri Jan 29 17:25:17 2021 +0100
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Mon Mar 29 17:04:43 2021 +0200

    tdf#125560 PPTX import: fix WordArt effect textDeflate and textInflateTop
    
    These effects were mapped incorrectly, resulting missing display
    and after ODP round-trip, changed effects.
    
    Code pointers and test documents by Regina Henschel.
    
    Change-Id: I8a05702b1c48492b9542dd827b1ac1daf2423bfd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112786
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>

diff --git a/oox/source/drawingml/presetgeometrynames.cxx 
b/oox/source/drawingml/presetgeometrynames.cxx
index d74cd352b282..04dff605c629 100644
--- a/oox/source/drawingml/presetgeometrynames.cxx
+++ b/oox/source/drawingml/presetgeometrynames.cxx
@@ -52,10 +52,10 @@ const PresetGeometryName pPresetGeometryNameArray[]
         { "textDoubleWave1", "mso-spt158" },
         { "textWave4", "mso-spt159" },
         { "textInflate", "fontwork-inflate" },
-        { "textDeflate", "fontwork-inflate" },
+        { "textDeflate", "mso-spt161" },
         { "textInflateBottom", "mso-spt162" },
         { "textDeflateBottom", "mso-spt163" },
-        { "textInflateTop", "mso-spt163" },
+        { "textInflateTop", "mso-spt164" },
         { "textDeflateTop", "mso-spt165" },
         { "textDeflateInflate", "mso-spt166" },
         { "textDeflateInflateDeflate", "mso-spt167" },
diff --git a/sd/qa/unit/data/pptx/ShapePlusImage.pptx 
b/sd/qa/unit/data/pptx/ShapePlusImage.pptx
new file mode 100644
index 000000000000..dd9424d172ce
Binary files /dev/null and b/sd/qa/unit/data/pptx/ShapePlusImage.pptx differ
diff --git a/sd/qa/unit/data/pptx/ShapeTextInflateTop.pptx 
b/sd/qa/unit/data/pptx/ShapeTextInflateTop.pptx
new file mode 100644
index 000000000000..cc8fd027909f
Binary files /dev/null and b/sd/qa/unit/data/pptx/ShapeTextInflateTop.pptx 
differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 839b9553a00e..432bd79d1993 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -209,6 +209,8 @@ public:
     void testShapeShadowBlurEffect();
     void testTdf119223();
     void testTdf128213ShapeRot();
+    void testTdf125560_textDeflate();
+    void testTdf125560_textInflateTop();
 
     CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -332,6 +334,8 @@ public:
     CPPUNIT_TEST(testShapeShadowBlurEffect);
     CPPUNIT_TEST(testTdf119223);
     CPPUNIT_TEST(testTdf128213ShapeRot);
+    CPPUNIT_TEST(testTdf125560_textDeflate);
+    CPPUNIT_TEST(testTdf125560_textInflateTop);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -357,6 +361,9 @@ public:
             { "wps", 
"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"; },
             { "wpg", 
"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"; },
             { "dgm", 
"http://schemas.openxmlformats.org/drawingml/2006/diagram"; },
+            // ODF
+            { "office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0" },
+            { "draw", "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" },
         };
         for (size_t i = 0; i < SAL_N_ELEMENTS(namespaces); ++i)
         {
@@ -3125,6 +3132,33 @@ void SdOOXMLExportTest2::testTdf128213ShapeRot()
     assertXPath(pXmlDocRels, 
"/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr/a:scene3d/a:camera/a:rot", 
"rev", "5400000");
 }
 
+void SdOOXMLExportTest2::testTdf125560_textDeflate()
+{
+    auto xDocShRef
+        = loadURL( 
m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/ShapePlusImage.pptx"), PPTX 
);
+    utl::TempFile tempFile;
+
+    // This problem did not affect the pptx export, only the ODP so assert that
+    xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
+    xDocShRef->DoClose();
+
+    xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, "content.xml");
+    assertXPath(pXmlDocRels, 
"/office:document-content/office:body/office:presentation/draw:page/draw:custom-shape/draw:enhanced-geometry",
 "type", "mso-spt161");
+}
+
+void SdOOXMLExportTest2::testTdf125560_textInflateTop()
+{
+    auto xDocShRef
+        = loadURL( 
m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/ShapeTextInflateTop.pptx"), 
PPTX );
+    utl::TempFile tempFile;
+
+    // This problem did not affect the pptx export, only the ODP so assert that
+    xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
+    xDocShRef->DoClose();
+
+    xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, "content.xml");
+    assertXPath(pXmlDocRels, 
"/office:document-content/office:body/office:presentation/draw:page/draw:custom-shape/draw:enhanced-geometry",
 "type", "mso-spt164");
+}
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to