Kaydet (Commit) eebd963d authored tarafından Miklos Vajna's avatar Miklos Vajna

drawingml customshape export: handle docx corner cases

Change-Id: I4b2b13c0855180acbfe34b594e12e493d4f04120
üst cd725211
...@@ -288,17 +288,22 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape ) ...@@ -288,17 +288,22 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape )
} }
FSHelperPtr pFS = GetFS(); FSHelperPtr pFS = GetFS();
pFS->startElementNS( mnXmlNamespace, XML_sp, FSEND ); pFS->startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp), FSEND );
// non visual shape properties // non visual shape properties
pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND ); if (GetDocumentType() != DOCUMENT_DOCX)
pFS->singleElementNS( mnXmlNamespace, XML_cNvPr, {
XML_id, I32S( GetNewShapeID( xShape ) ), pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
XML_name, IDS( CustomShape ), pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
FSEND ); XML_id, I32S( GetNewShapeID( xShape ) ),
pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, FSEND ); XML_name, IDS( CustomShape ),
WriteNonVisualProperties( xShape ); FSEND );
pFS->endElementNS( mnXmlNamespace, XML_nvSpPr ); pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, FSEND );
WriteNonVisualProperties( xShape );
pFS->endElementNS( mnXmlNamespace, XML_nvSpPr );
}
else
pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr, FSEND);
// visual shape properties // visual shape properties
pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND ); pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
...@@ -322,7 +327,7 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape ) ...@@ -322,7 +327,7 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape )
// write text // write text
WriteTextBox( xShape, mnXmlNamespace ); WriteTextBox( xShape, mnXmlNamespace );
pFS->endElementNS( mnXmlNamespace, XML_sp ); pFS->endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp) );
return *this; return *this;
} }
...@@ -732,6 +737,8 @@ ShapeExport& ShapeExport::WriteTextBox( Reference< XInterface > xIface, sal_Int3 ...@@ -732,6 +737,8 @@ ShapeExport& ShapeExport::WriteTextBox( Reference< XInterface > xIface, sal_Int3
WriteText( xIface ); WriteText( xIface );
pFS->endElementNS( nXmlNamespace, XML_txBody ); pFS->endElementNS( nXmlNamespace, XML_txBody );
} }
else if (GetDocumentType() == DOCUMENT_DOCX)
mpFS->singleElementNS(nXmlNamespace, XML_bodyPr, FSEND);
return *this; return *this;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment