diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-03-26 12:55:44 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-03-26 12:55:59 +0200 |
commit | 7a19798c73fd39d8d69ff6364f0696e68cdd1381 (patch) | |
tree | 683fa6cb8d20d69e3bd9c8bfa499ff8f93c16a39 | |
parent | a2ee8055e9c136923f0244fe289cac6377933c31 (diff) |
Compatibility option for incorrect relative moves after closePath (fdo#47406)
-rw-r--r-- | basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx | 7 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dsvgpolypolygon.cxx | 4 | ||||
-rw-r--r-- | xmloff/inc/xexptran.hxx | 3 | ||||
-rw-r--r-- | xmloff/source/draw/xexptran.cxx | 15 | ||||
-rw-r--r-- | xmloff/source/draw/ximp3dobject.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/style/MarkerStyle.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.cxx | 3 |
8 files changed, 28 insertions, 16 deletions
diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx index 54437bafd0a2..091614ac7ff4 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx @@ -118,10 +118,15 @@ namespace basegfx @param rSvgDAttribute A valid SVG-D attribute string + @param rWrongPositionAfterZ + Indicates wheter the generator interprets wrongly + the position in the path after Z or z elements + https://bugs.freedesktop.org/show_bug.cgi?id=47406 + @return true, if the string was successfully parsed */ BASEGFX_DLLPUBLIC bool importFromSvgD( B2DPolyPolygon& o_rPolyPoly, - const ::rtl::OUString& rSvgDAttribute ); + const ::rtl::OUString& rSvgDAttribute, bool bWrongPositionAfterZ = false ); /** Read poly-polygon from SVG. diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx index 590b8db8f56f..e3e60cd22095 100644 --- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx +++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx @@ -209,7 +209,7 @@ namespace basegfx } } - bool importFromSvgD(B2DPolyPolygon& o_rPolyPolygon, const ::rtl::OUString& rSvgDStatement) + bool importFromSvgD(B2DPolyPolygon& o_rPolyPolygon, const ::rtl::OUString& rSvgDStatement, bool bWrongPositionAfterZ) { o_rPolyPolygon.clear(); const sal_Int32 nLen(rSvgDStatement.getLength()); @@ -240,7 +240,7 @@ namespace basegfx bIsClosed = true; // update current point - we're back at the start - if( aCurrPoly.count() ) + if( aCurrPoly.count() && !bWrongPositionAfterZ) { const B2DPoint aFirst( aCurrPoly.getB2DPoint(0) ); nLastX = aFirst.getX(); diff --git a/xmloff/inc/xexptran.hxx b/xmloff/inc/xexptran.hxx index 814ad2aebce4..86883cfc7e4e 100644 --- a/xmloff/inc/xexptran.hxx +++ b/xmloff/inc/xexptran.hxx @@ -36,6 +36,7 @@ #include <com/sun/star/awt/Size.hpp> #include <com/sun/star/drawing/HomogenMatrix.hpp> #include <tools/mapunit.hxx> +#include <xmloff/xmlimp.hxx> #include <vector> @@ -171,7 +172,7 @@ public: const SdXMLImExViewBox& rViewBox, const com::sun::star::awt::Point& rObjectPos, const com::sun::star::awt::Size& rObjectSize, - const SvXMLUnitConverter& rConv); + const SvXMLImport& rImport); void AddPolygon( com::sun::star::drawing::PointSequence* pPoints, diff --git a/xmloff/source/draw/xexptran.cxx b/xmloff/source/draw/xexptran.cxx index 603298419319..80a61ac33a27 100644 --- a/xmloff/source/draw/xexptran.cxx +++ b/xmloff/source/draw/xexptran.cxx @@ -2121,7 +2121,7 @@ SdXMLImExSvgDElement::SdXMLImExSvgDElement(const OUString& rNew, const SdXMLImExViewBox& rViewBox, const awt::Point& rObjectPos, const awt::Size& rObjectSize, - const SvXMLUnitConverter& /*rConv*/) + const SvXMLImport& rImport) : msString( rNew ), mrViewBox( rViewBox ), mbIsClosed( false ), @@ -2130,9 +2130,20 @@ SdXMLImExSvgDElement::SdXMLImExSvgDElement(const OUString& rNew, mnLastY( 0L ), maPoly() { + bool bWrongPositionAfterZ( false ); + sal_Int32 nUPD( 0 ); + sal_Int32 nBuildId( 0 ); + if ( rImport.getBuildIds( nUPD, nBuildId ) && + ( ( nUPD == 641 ) || ( nUPD == 645 ) || ( nUPD == 680 ) || ( nUPD == 300 ) || + ( nUPD == 310 ) || ( nUPD == 320 ) || ( nUPD == 330 ) || ( nUPD == 340 ) || + ( nUPD == 350 && nBuildId < 202 ) ) ) + { + bWrongPositionAfterZ = true; + } + // convert string to polygon basegfx::B2DPolyPolygon aPoly; - basegfx::tools::importFromSvgD(aPoly,msString); + basegfx::tools::importFromSvgD(aPoly,msString,bWrongPositionAfterZ); mbIsCurve = aPoly.areControlPointsUsed(); mbIsClosed = aPoly.isClosed(); diff --git a/xmloff/source/draw/ximp3dobject.cxx b/xmloff/source/draw/ximp3dobject.cxx index 1d84030851e2..eacf1df1b1eb 100644 --- a/xmloff/source/draw/ximp3dobject.cxx +++ b/xmloff/source/draw/ximp3dobject.cxx @@ -399,8 +399,7 @@ void SdXML3DPolygonBasedShapeContext::StartElement(const uno::Reference< xml::sa SdXMLImExViewBox aViewBox(maViewBox, GetImport().GetMM100UnitConverter()); awt::Point aMinPoint(aViewBox.GetX(), aViewBox.GetY()); awt::Size aMaxSize(aViewBox.GetWidth(), aViewBox.GetHeight()); - SdXMLImExSvgDElement aPoints(maPoints, aViewBox, - aMinPoint, aMaxSize, GetImport().GetMM100UnitConverter()); + SdXMLImExSvgDElement aPoints(maPoints, aViewBox, aMinPoint, aMaxSize, GetImport()); // convert to double sequences drawing::PointSequenceSequence& xPoSeSe = diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 6d2192ac6e3a..ef5d5e69ca96 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -1420,8 +1420,7 @@ void SdXMLPathShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib { aSize = maSize; } - SdXMLImExSvgDElement aPoints(maD, aViewBox, - aPosition, aSize, GetImport().GetMM100UnitConverter()); + SdXMLImExSvgDElement aPoints(maD, aViewBox, aPosition, aSize, GetImport()); const char* pService; // now create shape @@ -1860,8 +1859,7 @@ void SdXMLConnectorShapeContext::processAttribute( sal_uInt16 nPrefix, const ::r awt::Point aPoint( 0, 0 ); awt::Size aSize( 1, 1 ); - SdXMLImExSvgDElement aPoints( rValue, aViewBox, - aPoint, aSize, GetImport().GetMM100UnitConverter() ); + SdXMLImExSvgDElement aPoints( rValue, aViewBox, aPoint, aSize, GetImport() ); if ( aPoints.IsCurve() ) { diff --git a/xmloff/source/style/MarkerStyle.cxx b/xmloff/source/style/MarkerStyle.cxx index 05a57e6ef093..4e51a57f02d0 100644 --- a/xmloff/source/style/MarkerStyle.cxx +++ b/xmloff/source/style/MarkerStyle.cxx @@ -107,8 +107,7 @@ sal_Bool XMLMarkerStyleImport::importXML( if( bHasViewBox && bHasPathData ) { SdXMLImExSvgDElement aPoints(strPathData, *pViewBox, awt::Point( 0, 0 ), - awt::Size( pViewBox->GetWidth(), pViewBox->GetHeight() ), - rUnitConverter ); + awt::Size( pViewBox->GetWidth(), pViewBox->GetHeight() ), rImport ); if(aPoints.IsCurve()) { diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 8be7e75abe36..815aa2503946 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -312,8 +312,7 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl( Any aAny; if( bPath ) { - SdXMLImExSvgDElement aPoints( sD, aViewBox, aPoint, aSize, - GetImport().GetMM100UnitConverter() ); + SdXMLImExSvgDElement aPoints( sD, aViewBox, aPoint, aSize, GetImport() ); aAny <<= aPoints.GetPointSequenceSequence(); } else |