[Libreoffice-commits] core.git: xmloff/source

Armin Le Grand alg at apache.org
Tue Nov 5 16:13:44 CET 2013


 xmloff/source/draw/shapeexport.cxx |   22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

New commits:
commit f689578dc4f3a77f6a3e72bbf32adf88a2c55526
Author: Armin Le Grand <alg at apache.org>
Date:   Wed Oct 30 14:41:25 2013 +0000

    Resolves: #i123542# corrected ODF XML export of 3D cube and sphere
    
    (cherry picked from commit a8cc15c001ac76c0d320837cc4cdf65ecb7fc923)
    
    Conflicts:
    	xmloff/source/draw/shapeexport2.cxx
    	xmloff/source/draw/shapeexport3.cxx
    
    Change-Id: I35f7817f3ea95177dd3aa633b9cbb1b5703f08a0

diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index ec3ec75c..fef66ec 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2211,9 +2211,9 @@ void XMLShapeExport::ImpExportPolygonShape(
             }
         }
 
-        // 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
+        // write object, but after attributes are added since this call will
+        // consume all of these added attributes and the destructor will close the
+        // scope. Also before text is added; this may add sub-scopes as needed
         SvXMLElementExport aOBJ(
             mrExport,
             XML_NAMESPACE_DRAW,
@@ -3320,9 +3320,6 @@ void XMLShapeExport::ImpExport3DShape(
         {
             case XmlShapeTypeDraw3DCubeObject:
             {
-                // write 3DCube shape
-                SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DR3D, XML_CUBE, sal_True, sal_True);
-
                 // minEdge
                 aAny = xPropSet->getPropertyValue("D3DPosition");
                 drawing::Position3D aPosition3D;
@@ -3354,13 +3351,15 @@ void XMLShapeExport::ImpExport3DShape(
                     mrExport.AddAttribute(XML_NAMESPACE_DR3D, XML_MAX_EDGE, aStr);
                 }
 
+                // write 3DCube shape
+                // #i123542# Do this *after* the attributes are added, else these will be lost since opening
+                // the scope will clear the global attribute list at the exporter
+                SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DR3D, XML_CUBE, sal_True, sal_True);
+
                 break;
             }
             case XmlShapeTypeDraw3DSphereObject:
             {
-                // write 3DSphere shape
-                SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DR3D, XML_SPHERE, sal_True, sal_True);
-
                 // Center
                 aAny = xPropSet->getPropertyValue("D3DPosition");
                 drawing::Position3D aPosition3D;
@@ -3389,6 +3388,11 @@ void XMLShapeExport::ImpExport3DShape(
                     mrExport.AddAttribute(XML_NAMESPACE_DR3D, XML_SIZE, aStr);
                 }
 
+                // write 3DSphere shape
+                // #i123542# Do this *after* the attributes are added, else these will be lost since opening
+                // the scope will clear the global attribute list at the exporter
+                SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DR3D, XML_SPHERE, sal_True, sal_True);
+
                 break;
             }
             case XmlShapeTypeDraw3DLatheObject:


More information about the Libreoffice-commits mailing list