summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-01-02 11:56:39 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-02 12:09:22 +0100
commitaffcea4185ffa95385cfb74ca68fa31361d6784b (patch)
tree7b1a12413e7c8df0870597ae633145592717fe81 /oox
parenta34341376f642402e34939aba59da0260e5c9b5d (diff)
oox: fix export of LineShapes in DOCX
Change-Id: I7b6f4616d450d2cffa58217db2ef250f5b8d9cba
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/shapes.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index a26da948660b..59af378592f2 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -615,7 +615,7 @@ ShapeExport& ShapeExport::WriteLineShape( Reference< XShape > xShape )
FSHelperPtr pFS = GetFS();
- pFS->startElementNS( mnXmlNamespace, XML_sp, FSEND );
+ pFS->startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp), FSEND );
PolyPolygon aPolyPolygon = EscherPropertyContainer::GetPolyPolygon( xShape );
if( aPolyPolygon.Count() == 1 && aPolyPolygon[ 0 ].GetSize() == 2)
@@ -627,14 +627,20 @@ ShapeExport& ShapeExport::WriteLineShape( Reference< XShape > xShape )
}
// non visual shape properties
- pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
- pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
- XML_id, I32S( GetNewShapeID( xShape ) ),
- XML_name, IDS( Line ),
- FSEND );
+ if (GetDocumentType() != DOCUMENT_DOCX)
+ {
+ pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
+ pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
+ XML_id, I32S( GetNewShapeID( xShape ) ),
+ XML_name, IDS( Line ),
+ FSEND );
+ }
pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, 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 );
@@ -648,7 +654,7 @@ ShapeExport& ShapeExport::WriteLineShape( Reference< XShape > xShape )
// write text
WriteTextBox( xShape, mnXmlNamespace );
- pFS->endElementNS( mnXmlNamespace, XML_sp );
+ pFS->endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp) );
return *this;
}