diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-24 17:53:38 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-24 18:02:42 +0200 |
commit | 36ac7749523e0c6f40a77beac278bd9e7a667a9b (patch) | |
tree | ffb71be02ed4ce516d40510e1daa1f799d36943d /writerfilter | |
parent | 2916dfdb2361e68a6bbbcb0b0e9e114e052cb6d5 (diff) |
DOCX import: make sure rotation does not affect shape position
Change-Id: I7916a24d63bb7c995267059e9bedbf1f08adc152
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index eb920bb157f3..e2ad1093fea2 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -779,9 +779,23 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) if (xServiceInfo->supportsService("com.sun.star.drawing.GroupShape") || xServiceInfo->supportsService("com.sun.star.drawing.GraphicObjectShape")) { + // You would expect that position and rotation are + // independent, but they are not. Till we are not + // there yet to handle all scaling, translation and + // rotation with a single transformation matrix, + // make sure there is no rotation set when we set + // the position. + sal_Int32 nRotation = 0; + xShapeProps->getPropertyValue("RotateAngle") >>= nRotation; + if (nRotation) + xShapeProps->setPropertyValue("RotateAngle", uno::makeAny(sal_Int32(0))); + // Position of the groupshape should be set after children have been added. // fdo#80555: also set position for graphic shapes here m_xShape->setPosition(awt::Point(m_pImpl->nLeftPosition, m_pImpl->nTopPosition)); + + if (nRotation) + xShapeProps->setPropertyValue("RotateAngle", uno::makeAny(nRotation)); } m_pImpl->applyRelativePosition(xShapeProps); |