diff options
-rw-r--r-- | oox/source/export/shapes.cxx | 3 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf143860_NonPrimitiveCustomShape.odt | bin | 0 -> 9408 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 11 |
3 files changed, 13 insertions, 1 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 23ea202db76b..1bcabf38eb49 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -843,7 +843,8 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) bool bPresetWriteSuccessful = false; // Let the custom shapes what has name and preset information in OOXML, to be written // as preset ones with parameters. Try that with this converter class. - if (!sShapeType.startsWith("ooxml") && GetDocumentType() == DOCUMENT_DOCX + if (!sShapeType.startsWith("ooxml") && sShapeType != "non-primitive" + && GetDocumentType() == DOCUMENT_DOCX && xShape->getShapeType() == "com.sun.star.drawing.CustomShape") { DMLPresetShapeExporter aCustomShapeConverter(this, xShape); diff --git a/sw/qa/extras/ooxmlexport/data/tdf143860_NonPrimitiveCustomShape.odt b/sw/qa/extras/ooxmlexport/data/tdf143860_NonPrimitiveCustomShape.odt Binary files differnew file mode 100644 index 000000000000..6a1222877031 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf143860_NonPrimitiveCustomShape.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index 2b3d92b55701..bd8338315381 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -70,6 +70,17 @@ protected: } }; +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf143860NonPrimitiveCustomShape, + "tdf143860_NonPrimitiveCustomShape.odt") +{ + // The document has a custom shape of type non-primitive without handles. Make sure that the shape + // is not exported with preset but with custom geometry. + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXmlDocument); + assertXPath(pXmlDocument, "//a:prstGeom", 0); + assertXPath(pXmlDocument, "//a:custGeom", 1); +} + DECLARE_OOXMLEXPORT_TEST(testTdf136059, "tdf136059.odt") { CPPUNIT_ASSERT_EQUAL_MESSAGE("Contour has not been exported!", true, |