summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-10-24 22:39:08 +0200
committerAndras Timar <andras.timar@collabora.com>2017-11-06 20:20:58 +0100
commit25470a3cf04c0244a1bcda46d7064a7c727ae65f (patch)
tree7d38edcc67087813d58db29f27de6853bf9f0982 /oox
parent08fa0c2d549a662857028783a10292667058fc1d (diff)
PPTX export: correct position of rotated groups
* added testcase for tdf#113263 Change-Id: I7abf68d8fb4ffd8b883cfbf4d69916912add8182 Reviewed-on: https://gerrit.libreoffice.org/43794 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/43990 Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index badd82c9b319..fef1316517b4 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1186,11 +1186,17 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa
awt::Point aPos = rXShape->getPosition();
awt::Size aSize = rXShape->getSize();
+ bool bPositiveY = true;
+ bool bPositiveX = true;
+
if (m_xParent.is())
{
awt::Point aParentPos = m_xParent->getPosition();
aPos.X -= aParentPos.X;
aPos.Y -= aParentPos.Y;
+
+ bPositiveX = aParentPos.X > 0;
+ bPositiveY = aParentPos.Y > 0;
}
if ( aSize.Width < 0 )
@@ -1208,6 +1214,17 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa
aPos.X-=(1-faccos*cos(nRotation*F_PI18000))*aSize.Width/2-facsin*sin(nRotation*F_PI18000)*aSize.Height/2;
aPos.Y-=(1-faccos*cos(nRotation*F_PI18000))*aSize.Height/2+facsin*sin(nRotation*F_PI18000)*aSize.Width/2;
}
+ else if(nRotation == 18000)
+ {
+ if (!bFlipV && bPositiveX)
+ {
+ aPos.X -= aSize.Width;
+ }
+ if (!bFlipH && bPositiveY)
+ {
+ aPos.Y -= aSize.Height;
+ }
+ }
// The RotateAngle property's value is independent from any flipping, and that's exactly what we need here.
uno::Reference<beans::XPropertySet> xPropertySet(rXShape, uno::UNO_QUERY);