summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/export/shapes.cxx18
-rw-r--r--sw/qa/extras/ooxmlexport/data/bezier.odtbin0 -> 12174 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx8
3 files changed, 20 insertions, 6 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 59af378592f2..67cf3dc9706e 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -905,14 +905,20 @@ ShapeExport& ShapeExport::WriteTextShape( Reference< XShape > xShape )
{
FSHelperPtr pFS = GetFS();
- pFS->startElementNS( mnXmlNamespace, XML_sp, FSEND );
+ pFS->startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp), FSEND );
// non visual shape properties
- pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
- WriteNonVisualDrawingProperties( xShape, IDS( TextShape ) );
+ if (GetDocumentType() != DOCUMENT_DOCX)
+ {
+ pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
+ WriteNonVisualDrawingProperties( xShape, IDS( TextShape ) );
+ }
pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, XML_txBox, "1", FSEND );
- WriteNonVisualProperties( xShape );
- pFS->endElementNS( mnXmlNamespace, XML_nvSpPr );
+ if (GetDocumentType() != DOCUMENT_DOCX)
+ {
+ WriteNonVisualProperties( xShape );
+ pFS->endElementNS( mnXmlNamespace, XML_nvSpPr );
+ }
// visual shape properties
pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
@@ -923,7 +929,7 @@ ShapeExport& ShapeExport::WriteTextShape( Reference< XShape > xShape )
WriteTextBox( xShape, mnXmlNamespace );
- pFS->endElementNS( mnXmlNamespace, XML_sp );
+ pFS->endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp) );
return *this;
}
diff --git a/sw/qa/extras/ooxmlexport/data/bezier.odt b/sw/qa/extras/ooxmlexport/data/bezier.odt
new file mode 100644
index 000000000000..c73ed3e98f85
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/bezier.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 187cf4f62bf8..54042d4493d8 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2175,6 +2175,14 @@ DECLARE_OOXMLEXPORT_TEST(testRelorientation, "relorientation.docx")
CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType());
}
+DECLARE_OOXMLEXPORT_TEST(testBezier, "bezier.odt")
+{
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ // Check that no shape got lost: a bezier, a line and a text shape.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDraws->getCount());
+}
+
DECLARE_OOXMLEXPORT_TEST(testTrackChangesDeletedParagraphMark, "testTrackChangesDeletedParagraphMark.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");