summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-24 12:43:30 +0000
committerFridrich Strba <fridrich@documentfoundation.org>2014-01-24 16:49:04 +0000
commitb09fae12aaae3519559a1915d258525b5fbcfbca (patch)
tree4bd118b92c361bd90dd9265580afa3593610c6ab
parent25613ed6664c949c13aefddb3f5330638079483e (diff)
Resolves: fdo#73355 reconcile legacy path bug detection
reconcile "223f6b631c1b087754c0f9051fb55f029f2503ce Resolves: #i123433# Detect pseudo-vertices at svg import..." with "7a19798c73fd39d8d69ff6364f0696e68cdd1381" Compatibility option for incorrect relative moves after closePath (fdo#47406) and "a2ee8055e9c136923f0244fe289cac6377933c31" Fix fdo#47406 incorrect relative moves after closePath Change-Id: I1221099a40500aeb4165a3350d8ae2df1fd3111b (cherry picked from commit b663316e83ec6b19b8fc33ade38086b22ab04b67) Reviewed-on: https://gerrit.libreoffice.org/7633 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--include/xmloff/xmlimp.hxx2
-rw-r--r--xmloff/source/draw/ximp3dobject.cxx2
-rw-r--r--xmloff/source/draw/ximpshap.cxx20
-rw-r--r--xmloff/source/style/MarkerStyle.cxx2
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx2
5 files changed, 23 insertions, 5 deletions
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index b30529800971..6005677ff252 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -458,6 +458,8 @@ public:
bool embeddedFontAlreadyProcessed( const OUString& url );
virtual void NotifyEmbeddedFontRead() {};
+
+ bool needFixPositionAfterZ() const;
};
inline UniReference< XMLTextImportHelper > SvXMLImport::GetTextImport()
diff --git a/xmloff/source/draw/ximp3dobject.cxx b/xmloff/source/draw/ximp3dobject.cxx
index 6992a12c2314..4d7f7a1b35bb 100644
--- a/xmloff/source/draw/ximp3dobject.cxx
+++ b/xmloff/source/draw/ximp3dobject.cxx
@@ -357,7 +357,7 @@ void SdXML3DPolygonBasedShapeContext::StartElement(const uno::Reference< xml::sa
// import 2d PolyPolygon from svg:d
basegfx::B2DPolyPolygon aPolyPolygon;
- if(basegfx::tools::importFromSvgD(aPolyPolygon, maPoints, true, 0))
+ if(basegfx::tools::importFromSvgD(aPolyPolygon, maPoints, GetImport().needFixPositionAfterZ(), 0))
{
// convert to 3D PolyPolygon
const basegfx::B3DPolyPolygon aB3DPolyPolygon(
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 14a0d081c629..d227f166d9db 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -1398,7 +1398,7 @@ void SdXMLPathShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib
basegfx::B2DPolyPolygon aPolyPolygon;
- if(basegfx::tools::importFromSvgD(aPolyPolygon, maD, true, 0))
+ if(basegfx::tools::importFromSvgD(aPolyPolygon, maD, GetImport().needFixPositionAfterZ(), 0))
{
if(aPolyPolygon.count())
{
@@ -1752,6 +1752,22 @@ SdXMLConnectorShapeContext::~SdXMLConnectorShapeContext()
{
}
+bool SvXMLImport::needFixPositionAfterZ() const
+{
+ bool bWrongPositionAfterZ( false );
+ sal_Int32 nUPD( 0 );
+ sal_Int32 nBuildId( 0 );
+ if ( 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;
+ }
+ return bWrongPositionAfterZ;
+}
+
+
// this is called from the parent group for each unparsed attribute in the attribute list
void SdXMLConnectorShapeContext::processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue )
{
@@ -1841,7 +1857,7 @@ void SdXMLConnectorShapeContext::processAttribute( sal_uInt16 nPrefix, const OUS
{
basegfx::B2DPolyPolygon aPolyPolygon;
- if(basegfx::tools::importFromSvgD(aPolyPolygon, rValue, true, 0))
+ if(basegfx::tools::importFromSvgD(aPolyPolygon, rValue, GetImport().needFixPositionAfterZ(), 0))
{
if(aPolyPolygon.count())
{
diff --git a/xmloff/source/style/MarkerStyle.cxx b/xmloff/source/style/MarkerStyle.cxx
index a8b26d8ff908..698ec5cbd7dd 100644
--- a/xmloff/source/style/MarkerStyle.cxx
+++ b/xmloff/source/style/MarkerStyle.cxx
@@ -97,7 +97,7 @@ sal_Bool XMLMarkerStyleImport::importXML(
{
basegfx::B2DPolyPolygon aPolyPolygon;
- if(basegfx::tools::importFromSvgD(aPolyPolygon, strPathData, true, 0))
+ if(basegfx::tools::importFromSvgD(aPolyPolygon, strPathData, rImport.needFixPositionAfterZ(), 0))
{
if(aPolyPolygon.count())
{
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 37312211a755..95a6342dff01 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -295,7 +295,7 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl(
if( bPath )
{
- basegfx::tools::importFromSvgD(aPolyPolygon, sD, true, 0);
+ basegfx::tools::importFromSvgD(aPolyPolygon, sD, GetImport().needFixPositionAfterZ(), 0);
}
else
{