summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/export/drawingml.cxx17
-rw-r--r--sw/qa/extras/ooxmlexport/data/rot270-flipv.docxbin0 -> 15887 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx11
3 files changed, 15 insertions, 13 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 066049858a4b..99d636d2f588 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1166,19 +1166,10 @@ void DrawingML::WriteShapeTransformation( Reference< XShape > rXShape, sal_Int32
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)
- {
- // See SdrObjCustomShape::NbcRotate().
- int nSwap = 0;
- if (bFlipH)
- nSwap ^= 1;
- if (bFlipV)
- nSwap ^= 1;
- if (nSwap)
- {
- nRotation=(nRotation+18000)%36000;
- }
+
+ // 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);
+ xPropertySet->getPropertyValue("RotateAngle") >>= nRotation;
}
WriteTransformation( Rectangle( Point( aPos.X, aPos.Y ), Size( aSize.Width, aSize.Height ) ), nXmlNamespace, bFlipH, bFlipV, OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(nRotation) );
}
diff --git a/sw/qa/extras/ooxmlexport/data/rot270-flipv.docx b/sw/qa/extras/ooxmlexport/data/rot270-flipv.docx
new file mode 100644
index 000000000000..0aa19e08a05a
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/rot270-flipv.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index c8e2470a18c4..fc12ff13c742 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -326,6 +326,17 @@ DECLARE_OOXMLEXPORT_TEST(testRot180Flipv, "rot180-flipv.docx")
}
}
+DECLARE_OOXMLEXPORT_TEST(testRot270Flipv, "rot270-flipv.docx")
+{
+ // 270° rotation got turned into 90° after roundtrip.
+ if (xmlDocPtr pXmlDoc = parseExport("word/document.xml"))
+ {
+ assertXPath(pXmlDoc, "//a:xfrm", "flipV", "1");
+ // This was 5400000.
+ assertXPath(pXmlDoc, "//a:xfrm", "rot", "16200000");
+ }
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */