summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-01-23 13:34:34 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-23 15:30:11 +0100
commit6063555744ed89d8a757b667cddcdd4357839466 (patch)
tree943e35b211c85a732614e439280f7732306711bf
parent30a561c0082d98c195caaa255c50fb6f0f679cc1 (diff)
drawingML export: fix position of shape in case rotation is 180 degrees
This is the other case when position shouldn't be adjusted. Change-Id: I9265bf1c762fd519e3a12e97d767b5d213644e6d
-rw-r--r--include/oox/export/drawingml.hxx2
-rw-r--r--oox/source/export/drawingml.cxx2
-rw-r--r--sw/qa/extras/ooxmlexport/data/dml-textshape.docxbin16496 -> 16554 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx4
4 files changed, 7 insertions, 1 deletions
diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
index 65ae6f3d1281..31c6f20772f4 100644
--- a/include/oox/export/drawingml.hxx
+++ b/include/oox/export/drawingml.hxx
@@ -28,6 +28,8 @@
#include <tools/poly.hxx>
#include <filter/msfilter/escherex.hxx>
#ifndef PPTX_EXPORT_ROTATE_CLOCKWISIFY
+// Our rotation is counter-clockwise and is in 100ths of a degree.
+// drawingML rotation is clockwise and is in 60000ths of a degree.
#define PPTX_EXPORT_ROTATE_CLOCKWISIFY(input) ((21600000-input*600)%21600000)
#endif
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 2fde292cce42..db050300cb69 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -751,7 +751,7 @@ void DrawingML::WriteShapeTransformation( Reference< XShape > rXShape, sal_Int32
{
SdrObject* pShape = (SdrObject*) GetSdrObjectFromXShape( rXShape );
nRotation=pShape->GetRotateAngle();
- if (nRotation)
+ if (nRotation != 0 && nRotation != 18000)
{
int faccos=bFlipV ? -1 : 1;
int facsin=bFlipH ? -1 : 1;
diff --git a/sw/qa/extras/ooxmlexport/data/dml-textshape.docx b/sw/qa/extras/ooxmlexport/data/dml-textshape.docx
index b98eea79c054..28e39c29a9b2 100644
--- a/sw/qa/extras/ooxmlexport/data/dml-textshape.docx
+++ b/sw/qa/extras/ooxmlexport/data/dml-textshape.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index c18277c376de..9ce53cb3d646 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2492,6 +2492,10 @@ DECLARE_OOXMLEXPORT_TEST(testDmlTextshape, "dml-textshape.docx")
// Connector was incorrectly shifted towards the top left corner, X was 552, Y was 0.
CPPUNIT_ASSERT_EQUAL(sal_Int32(4018), xShape->getPosition().X);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1256), xShape->getPosition().Y);
+
+ xShape.set(xGroup->getByIndex(5), uno::UNO_QUERY);
+ // This was incorrectly shifted towards the top of the page, Y was 106.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1016), xShape->getPosition().Y);
}
DECLARE_OOXMLEXPORT_TEST(testDrawinglayerPicPos, "drawinglayer-pic-pos.docx")