diff options
author | Armin Le Grand <alg@apache.org> | 2013-04-08 11:46:32 +0000 |
---|---|---|
committer | Xisco Fauli <anistenis@gmail.com> | 2013-05-18 19:02:26 +0200 |
commit | f9da1991ed0cf5936797d92f004462dbe93f1be7 (patch) | |
tree | 4a030dc8524829eaf2573c93efd643a98df1d667 /xmloff | |
parent | Resolves: #i116244# need to reset rotation... (diff) | |
download | core-f9da1991ed0cf5936797d92f004462dbe93f1be7.tar.gz core-f9da1991ed0cf5936797d92f004462dbe93f1be7.zip |
i121965 Take draw:transform into account for draw:connector shapes
(cherry picked from commit 7b3f5521bd3c400cd9e08b745176b4ce40885011)
Conflicts:
xmloff/source/draw/ximpshap.cxx
Change-Id: I973627f85ce6463c863863d6c180cb4c2cab86d0
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index eb7171b90723..72f528b61e4b 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -78,7 +78,7 @@ #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/text/XTextDocument.hpp> - +#include <basegfx/point/b2dpoint.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -1813,6 +1813,11 @@ void SdXMLConnectorShapeContext::processAttribute( sal_uInt16 nPrefix, const OUS SvXMLUnitConverter::convertEnum( mnType, rValue, aXML_ConnectionKind_EnumMap ); return; } + // #121965# draw:transform may be used in ODF1.2, e.g. exports from MS seem to use these + else if( IsXMLToken( rLocalName, XML_TRANSFORM ) ) + { + mnTransform.SetString(rValue, GetImport().GetMM100UnitConverter()); + } } case XML_NAMESPACE_SVG: { @@ -1903,6 +1908,29 @@ void SdXMLConnectorShapeContext::StartElement(const uno::Reference< xml::sax::XA AddShape("com.sun.star.drawing.ConnectorShape"); if(mxShape.is()) { + // #121965# if draw:transform is used, apply directly to the start + // and end positions before using these + if(mnTransform.NeedsAction()) + { + // transformation is used, apply to object. + ::basegfx::B2DHomMatrix aMat; + mnTransform.GetFullTransform(aMat); + + if(!aMat.isIdentity()) + { + basegfx::B2DPoint aStart(maStart.X, maStart.Y); + basegfx::B2DPoint aEnd(maEnd.X, maEnd.Y); + + aStart = aMat * aStart; + aEnd = aMat * aEnd; + + maStart.X = basegfx::fround(aStart.getX()); + maStart.Y = basegfx::fround(aStart.getY()); + maEnd.X = basegfx::fround(aEnd.getX()); + maEnd.Y = basegfx::fround(aEnd.getY()); + } + } + // add connection ids if( !maStartShapeId.isEmpty() ) GetImport().GetShapeImport()->addShapeConnection( mxShape, sal_True, maStartShapeId, mnStartGlueId ); |