Blob Blame History Raw
From d8720d4e390143279ccae8eed05decf54240e8fa Mon Sep 17 00:00:00 2001
From: Radek Doulik <rodo@novell.com>
Date: Thu, 19 Jul 2012 11:06:50 +0200
Subject: [PATCH] odf: export arcangleto commands in enhanced path (use drawooo
 namespace)

Change-Id: I43a2c08ee8dfc0abe4d05579b837b5be0944c0fe
---
 xmloff/source/core/xmlexp.cxx          | 3 ++-
 xmloff/source/draw/sdxmlexp.cxx        | 5 -----
 xmloff/source/draw/shapeexport4.cxx    | 5 ++++-
 xmloff/source/draw/ximpcustomshape.cxx | 7 +++++++
 4 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 82c414e..cbf9ef3 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -375,7 +375,8 @@ void SvXMLExport::_InitCtor()
                 GetXMLToken(XML_NP_TABLE_EXT), GetXMLToken(XML_N_TABLE_EXT), XML_NAMESPACE_TABLE_EXT);
             mpNamespaceMap->Add(
                 GetXMLToken(XML_NP_CALC_EXT), GetXMLToken(XML_N_CALC_EXT), XML_NAMESPACE_CALC_EXT);
-
+            mpNamespaceMap->Add(
+                GetXMLToken(XML_NP_DRAW_EXT), GetXMLToken(XML_N_DRAW_EXT), XML_NAMESPACE_DRAW_EXT);
         }
     }
     if( (getExportFlags() & (EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 )
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index ce4d418..8927e92 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -641,11 +641,6 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent
             GetXMLToken(XML_NP_OFFICE_EXT),
             GetXMLToken(XML_N_OFFICE_EXT),
             XML_NAMESPACE_OFFICE_EXT);
-
-        _GetNamespaceMap().Add(
-            GetXMLToken(XML_NP_DRAW_EXT),
-            GetXMLToken(XML_N_DRAW_EXT),
-            XML_NAMESPACE_DRAW_EXT);
     }
 
     GetShapeExport()->enableLayerExport();
diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx
index aa4701d..43e75f9 100644
--- a/xmloff/source/draw/shapeexport4.cxx
+++ b/xmloff/source/draw/shapeexport4.cxx
@@ -329,6 +329,7 @@ void ImpExportEnhancedPath( SvXMLExport& rExport,
 
     rtl::OUString       aStr;
     rtl::OUStringBuffer aStrBuffer;
+    sal_uInt16 aNamespace = XML_NAMESPACE_DRAW;
 
     sal_Int32 i, j, k, l;
 
@@ -413,6 +414,8 @@ void ImpExportEnhancedPath( SvXMLExport& rExport,
                 aStrBuffer.append( (sal_Unicode)'Y' ); nParameter = 1; break;
             case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::QUADRATICCURVETO :
                 aStrBuffer.append( (sal_Unicode)'Q' ); nParameter = 2; break;
+            case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::ARCANGLETO :
+                aStrBuffer.append( (sal_Unicode)'G' ); nParameter = 2; aNamespace = XML_NAMESPACE_DRAW_EXT; break;
 
             default : // ups, seems to be something wrong
             {
@@ -442,7 +445,7 @@ void ImpExportEnhancedPath( SvXMLExport& rExport,
         }
     }
     aStr = aStrBuffer.makeStringAndClear();
-    rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ENHANCED_PATH, aStr );
+    rExport.AddAttribute( aNamespace, XML_ENHANCED_PATH, aStr );
 }
 
 void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< beans::XPropertySet >& xPropSet )
diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx
index 0736fe3..f8966a1 100644
--- a/xmloff/source/draw/ximpcustomshape.cxx
+++ b/xmloff/source/draw/ximpcustomshape.cxx
@@ -667,6 +667,13 @@ void GetEnhancedPath( std::vector< com::sun::star::beans::PropertyValue >& rDest
                 nIndex++;
             }
             break;
+            case 'G' :
+            {
+                nLatestSegmentCommand = com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::ARCANGLETO;
+                nParametersNeeded = 2;
+                nIndex++;
+            }
+            break;
             case 'W' :
             {
                 nLatestSegmentCommand = com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO;
-- 
1.8.1