Commits

Anonymous committed 811ad0b

sw33bf12: #i115492# method <SdXMLConnectorShapeContext::startElement(..)> - ignore svg:d attribute for text documents from OOo version before OOo 3.3

Comments (0)

Files changed (1)

xmloff/source/draw/ximpshap.cxx

 			SetLayer();
 
 			if ( maPath.hasValue() )
-				xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("PolyPolygonBezier") ), maPath );
+            {
+                // --> OD #i115492#
+                // Ignore svg:d attribute for text documents created by OpenOffice.org 
+                // versions before OOo 3.3, because these OOo versions are storing
+                // svg:d values not using the correct unit.
+                bool bApplySVGD( true );
+                if ( uno::Reference< text::XTextDocument >(GetImport().GetModel(), uno::UNO_QUERY).is() )
+                {
+                    sal_Int32 nUPD( 0 );
+                    sal_Int32 nBuild( 0 );
+                    const bool bBuildIdFound = GetImport().getBuildIds( nUPD, nBuild );
+                    if ( GetImport().IsTextDocInOOoFileFormat() ||
+                         ( bBuildIdFound &&
+                           ( ( nUPD == 641 ) || ( nUPD == 645 ) ||  // prior OOo 2.0
+                             ( nUPD == 680 ) ||                     // OOo 2.x
+                             ( nUPD == 300 ) ||                     // OOo 3.0 - OOo 3.0.1
+                             ( nUPD == 310 ) ||                     // OOo 3.1 - OOo 3.1.1
+                             ( nUPD == 320 ) ) ) )                  // OOo 3.2 - OOo 3.2.1
+                    {
+                        bApplySVGD = false;
+                    }    
+                }            
+
+                if ( bApplySVGD )
+                {
+                    xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("PolyPolygonBezier") ), maPath );
+                }                                                                                        
+                // <--
+            }
 
 			SdXMLShapeContext::StartElement(xAttrList);
 		}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.