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 <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
diff --git a/oox/source/drawingml/presetgeometrynames.cxx b/oox/source/drawingml/presetgeometrynames.cxx
index d74cd35..04dff60 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 0000000..dd9424d
--- /dev/null
+++ b/sd/qa/unit/data/pptx/ShapePlusImage.pptx
Binary files differ
diff --git a/sd/qa/unit/data/pptx/ShapeTextInflateTop.pptx b/sd/qa/unit/data/pptx/ShapeTextInflateTop.pptx
new file mode 100644
index 0000000..cc8fd02
--- /dev/null
+++ b/sd/qa/unit/data/pptx/ShapeTextInflateTop.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 839b955..432bd79 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);