[Libreoffice-commits] core.git: include/oox oox/source sw/qa
Miklos Vajna
vmiklos at collabora.co.uk
Thu Jan 23 06:30:35 PST 2014
include/oox/export/drawingml.hxx | 2 ++
oox/source/export/drawingml.cxx | 2 +-
sw/qa/extras/ooxmlexport/data/dml-textshape.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 4 ++++
4 files changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 6063555744ed89d8a757b667cddcdd4357839466
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jan 23 13:34:34 2014 +0100
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
diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
index 65ae6f3..31c6f20 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 2fde292..db05030 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 b98eea7..28e39c2 100644
Binary files a/sw/qa/extras/ooxmlexport/data/dml-textshape.docx and b/sw/qa/extras/ooxmlexport/data/dml-textshape.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index c18277c..9ce53cb 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")
More information about the Libreoffice-commits
mailing list