diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-10 14:46:48 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-10 14:51:02 +0100 |
commit | eebd963d6d5df8b7637093addfe1b4052eed1f8a (patch) | |
tree | 02a3c65e66817236858bdd9f885fc115bf80a52d /oox | |
parent | cd725211e7f26195f8027cff632994843928aa16 (diff) |
drawingml customshape export: handle docx corner cases
Change-Id: I4b2b13c0855180acbfe34b594e12e493d4f04120
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/shapes.cxx | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index c1836b2502f7..d63e8e78a955 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -288,17 +288,22 @@ ShapeExport& ShapeExport::WriteCustomShape( 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 ); - pFS->singleElementNS( mnXmlNamespace, XML_cNvPr, - XML_id, I32S( GetNewShapeID( xShape ) ), - XML_name, IDS( CustomShape ), - FSEND ); - pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, FSEND ); - WriteNonVisualProperties( xShape ); - pFS->endElementNS( mnXmlNamespace, XML_nvSpPr ); + if (GetDocumentType() != DOCUMENT_DOCX) + { + pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND ); + pFS->singleElementNS( mnXmlNamespace, XML_cNvPr, + XML_id, I32S( GetNewShapeID( xShape ) ), + XML_name, IDS( CustomShape ), + FSEND ); + pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, FSEND ); + WriteNonVisualProperties( xShape ); + pFS->endElementNS( mnXmlNamespace, XML_nvSpPr ); + } + else + pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr, FSEND); // visual shape properties pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND ); @@ -322,7 +327,7 @@ ShapeExport& ShapeExport::WriteCustomShape( 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; } @@ -732,6 +737,8 @@ ShapeExport& ShapeExport::WriteTextBox( Reference< XInterface > xIface, sal_Int3 WriteText( xIface ); pFS->endElementNS( nXmlNamespace, XML_txBody ); } + else if (GetDocumentType() == DOCUMENT_DOCX) + mpFS->singleElementNS(nXmlNamespace, XML_bodyPr, FSEND); return *this; } |