summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/export/drawingml.hxx2
-rw-r--r--oox/source/export/drawingml.cxx10
2 files changed, 9 insertions, 3 deletions
diff --git a/oox/inc/oox/export/drawingml.hxx b/oox/inc/oox/export/drawingml.hxx
index 486d792b08e1..6198ec608537 100644
--- a/oox/inc/oox/export/drawingml.hxx
+++ b/oox/inc/oox/export/drawingml.hxx
@@ -28,7 +28,7 @@
#include <tools/poly.hxx>
#include <filter/msfilter/escherex.hxx>
#ifndef PPTX_EXPORT_ROTATE_CLOCKWISIFY
-#define PPTX_EXPORT_ROTATE_CLOCKWISIFY(input) (21600000-input*600)
+#define PPTX_EXPORT_ROTATE_CLOCKWISIFY(input) ((21600000-input*600)%21600000)
#endif
class Graphic;
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 94bf8a1c4087..8389b3a2d0b0 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -643,8 +643,14 @@ void DrawingML::WriteShapeTransformation( Reference< XShape > rXShape, sal_Int32
{
SdrObject* pShape = (SdrObject*) GetSdrObjectFromXShape( rXShape );
nRotation=pShape->GetRotateAngle();
- aPos.X-=(1-cos(nRotation*F_PI18000))*aSize.Width/2-sin(nRotation*F_PI18000)*aSize.Height/2;
- aPos.Y-=(1-cos(nRotation*F_PI18000))*aSize.Height/2+sin(nRotation*F_PI18000)*aSize.Width/2;
+ int faccos=bFlipV ? -1 : 1;
+ int facsin=bFlipH ? -1 : 1;
+ 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;
+ }
+ if (!bSuppressRotation)
+ {
+ if (bFlipV) {nRotation=(nRotation+18000)%36000;}
}
WriteTransformation( Rectangle( Point( aPos.X, aPos.Y ), Size( aSize.Width, aSize.Height ) ), nXmlNamespace, bFlipH, bFlipV, PPTX_EXPORT_ROTATE_CLOCKWISIFY(nRotation) );
}