diff options
author | Radek Doulik <rodo@novell.com> | 2012-07-19 16:06:52 +0200 |
---|---|---|
committer | Radek Doulik <rodo@novell.com> | 2012-07-19 16:08:39 +0200 |
commit | 6928759a89fdc29391e85cf31f48ef6ac5ee6fa1 (patch) | |
tree | ff6d8ecc88e5b6ece7139931ca872b0a54182e21 /xmloff | |
parent | Related: fdo#46757 fix weird word/char count with hidden deleted text (diff) | |
download | core-6928759a89fdc29391e85cf31f48ef6ac5ee6fa1.tar.gz core-6928759a89fdc29391e85cf31f48ef6ac5ee6fa1.zip |
odf: export old path without unsupported commands in draw namespace as well
- to preserve at least some data for older versions of Libre Office
Change-Id: I2a33706c2a2344e45b57a00469a7387072f8602b
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/shapeexport4.cxx | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx index 43e75f97e72c..28bfd296bf46 100644 --- a/xmloff/source/draw/shapeexport4.cxx +++ b/xmloff/source/draw/shapeexport4.cxx @@ -323,13 +323,14 @@ void ImpExportHandles( SvXMLExport& rExport, const uno::Sequence< beans::Propert } void ImpExportEnhancedPath( SvXMLExport& rExport, - const uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair >& rCoordinates, - const uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment >& rSegments ) + const uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair >& rCoordinates, + const uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment >& rSegments, + bool bExtended = false ) { rtl::OUString aStr; rtl::OUStringBuffer aStrBuffer; - sal_uInt16 aNamespace = XML_NAMESPACE_DRAW; + bool bNeedExtended = false; sal_Int32 i, j, k, l; @@ -415,8 +416,15 @@ void ImpExportEnhancedPath( SvXMLExport& rExport, 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; - + if ( bExtended ) { + aStrBuffer.append( (sal_Unicode)'G' ); + nParameter = 2; + } else { + aStrBuffer.setLength( aStrBuffer.getLength() - 1); + bNeedExtended = true; + i += 2; + } + break; default : // ups, seems to be something wrong { aSegment.Count = 1; @@ -445,7 +453,9 @@ void ImpExportEnhancedPath( SvXMLExport& rExport, } } aStr = aStrBuffer.makeStringAndClear(); - rExport.AddAttribute( aNamespace, XML_ENHANCED_PATH, aStr ); + rExport.AddAttribute( bExtended ? XML_NAMESPACE_DRAW_EXT : XML_NAMESPACE_DRAW, XML_ENHANCED_PATH, aStr ); + if ( !bExtended && bNeedExtended ) + ImpExportEnhancedPath( rExport, rCoordinates, rSegments, true ); } void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< beans::XPropertySet >& xPropSet ) |