summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-01-02 11:58:57 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-02 12:09:22 +0100
commit3a45a4e80257d8737df4dda0b2d85f602196a70d (patch)
tree8fa80e3d7e3058b48e862b44a0b5fd1f20aa94b4 /oox
parentaffcea4185ffa95385cfb74ca68fa31361d6784b (diff)
oox: fix export of TextShapes in DOCX
This was the last shape type that unconditionally wrote XML_sp for the shape element, which is invalid for DOCX. Change-Id: I3a6f8e6fd8ebbe663dce9ed4453396c3ec91c38a
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/shapes.cxx18
1 files changed, 12 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;
}