diff options
-rw-r--r-- | oox/source/export/drawingml.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf104115.docx | bin | 0 -> 13044 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 10 |
3 files changed, 13 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 0951449950a3..8d0256594be4 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2540,7 +2540,9 @@ bool DrawingML::WriteCustomGeometry( const Reference< XShape >& rXShape ) void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon ) { - if( rPolyPolygon.Count() < 1 ) + // In case of Writer, the parent element is <wps:spPr>, and there the + // <a:custGeom> element is not optional. + if (rPolyPolygon.Count() < 1 && GetDocumentType() != DOCUMENT_DOCX) return; mpFS->startElementNS( XML_a, XML_custGeom, FSEND ); diff --git a/sw/qa/extras/ooxmlexport/data/tdf104115.docx b/sw/qa/extras/ooxmlexport/data/tdf104115.docx Binary files differnew file mode 100644 index 000000000000..9236f0e3a5c4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104115.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 8d117e675738..f4bd83e39f15 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -141,6 +141,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf103982, "tdf103982.docx") CPPUNIT_ASSERT(nDistB >= 0); } +DECLARE_OOXMLEXPORT_TEST(testTdf104115, "tdf104115.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + // This found 0 nodes: the custom geometry was not written for the Bezier + // curve -> Word refused to open the document. + assertXPath(pXmlDoc, "//a:custGeom", 1); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |