diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-10-24 22:39:08 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-11-06 14:36:15 +0100 |
commit | 20a5a0dc39d03eb91f03f64b597b58cf786e3451 (patch) | |
tree | 1f4bdbea2b43ab01b6b7336ca0fd8b6beb69ebfc /oox | |
parent | c99f02e17f436a5887578f0da55e4daae78a2ca6 (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/44322
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 686c8b3c8549..aa9ba6a4dfac 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1278,11 +1278,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 (GetDocumentType() == DOCUMENT_DOCX && 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 ) @@ -1300,6 +1306,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); |