diff options
author | Armin Le Grand <alg@apache.org> | 2013-10-30 12:52:12 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-11-05 15:00:18 +0000 |
commit | 0794e9ec93be4cfa11daefdb2e428952ea7669a5 (patch) | |
tree | cec3be44bb5065babf60a2f3738b025bae5a52b2 /xmloff/source/draw | |
parent | 8b2fb0e153fa846a171105b7801c398ffbe3d595 (diff) |
corrected export of polygons with text
(cherry picked from commit c0f65b29f8028ab750c8caac033645c3da3cf2f5)
Conflicts:
xmloff/source/draw/shapeexport2.cxx
Change-Id: Ic8da384d094ce735ecba51b282de7a697558e51f
Diffstat (limited to 'xmloff/source/draw')
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 68 |
1 files changed, 30 insertions, 38 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index e341f71b82dc..ec3ec75cfce3 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2097,26 +2097,27 @@ void XMLShapeExport::ImpExportEllipseShape( sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210# + // prepare name (with most used) + enum ::xmloff::token::XMLTokenEnum eName(XML_CIRCLE); + if(bCircle) { - // write circle - SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_CIRCLE, bCreateNewline, sal_True); - - ImpExportDescription( xShape ); // #i68101# - ImpExportEvents( xShape ); - ImpExportGluePoints( xShape ); - ImpExportText( xShape ); + // name already set } else { - // write ellipse - SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_ELLIPSE, bCreateNewline, sal_True); - - ImpExportDescription( xShape ); // #i68101# - ImpExportEvents( xShape ); - ImpExportGluePoints( xShape ); - ImpExportText( xShape ); + // set name + eName = XML_ELLIPSE; } + + // write ellipse or circle + SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, eName, bCreateNewline, sal_True); + + ImpExportDescription( xShape ); // #i68101# + ImpExportEvents( xShape ); + ImpExportGluePoints( xShape ); + ImpExportText( xShape ); + } } @@ -2152,6 +2153,9 @@ void XMLShapeExport::ImpExportPolygonShape( sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210# + // prepare name (with most used) + enum ::xmloff::token::XMLTokenEnum eName(XML_PATH); + if(bBezier) { // get PolygonBezier @@ -2171,15 +2175,6 @@ void XMLShapeExport::ImpExportPolygonShape( // write point array mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aPolygonString); - - // write object now - SvXMLElementExport aOBJ( - mrExport, - XML_NAMESPACE_DRAW, - XML_PATH, - bCreateNewline, - sal_True); - } } else @@ -2198,13 +2193,8 @@ void XMLShapeExport::ImpExportPolygonShape( // write point array mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_POINTS, aPointString); - // write object now - SvXMLElementExport aOBJ( - mrExport, - XML_NAMESPACE_DRAW, - aPolygon.isClosed() ? XML_POLYGON : XML_POLYLINE, - bCreateNewline, - sal_True); + // set name + eName = aPolygon.isClosed() ? XML_POLYGON : XML_POLYLINE; } else { @@ -2218,17 +2208,19 @@ void XMLShapeExport::ImpExportPolygonShape( // write point array mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aPolygonString); - - // write object now - SvXMLElementExport aOBJ( - mrExport, - XML_NAMESPACE_DRAW, - XML_PATH, - bCreateNewline, - sal_True); } } + // write object, but after attributes are added since the destructor will + // consume all of these added attributes. Also before text is added; this may + // open another SvXMLElementExport scope which needs to be inside this one + SvXMLElementExport aOBJ( + mrExport, + XML_NAMESPACE_DRAW, + eName, + bCreateNewline, + sal_True); + ImpExportDescription( xShape ); // #i68101# ImpExportEvents( xShape ); ImpExportGluePoints( xShape ); |