summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-08-01 14:08:34 +0300
committerAndras Timar <andras.timar@collabora.com>2018-09-13 11:56:54 +0200
commit8229f44e2a18c54055a5e2105dfbdceb3d98a50b (patch)
tree63f15e3422fd8725c4eb0729880077c728189e55 /sw
parent70cb1aa0e8cd4fe67792ae5f7e95d3396594b196 (diff)
tdf#91999 export/drawingml: shape rotate 180 is not special
This commit reverts the first (LO 4.3ish) regression commit 6063555744ed89d8a757b667cddcdd4357839466 and most of the two commits that tried to fix that: commit 9ae1e094d5a8a5b4432c88ebea0ca9fc1c79f602 and commit ee45d881efab230e7682f964d6ad4d00f85b0006 in LO6.0/6.2. The ooxmlexport6 unit test shows that there is nothing special about 180degrees. So, all transformations need to be avoided in docx format - not just 180 degree ones. I removed IsInGroupShape() since it is no longer being used - as per standard procedures. Reviewed-on: https://gerrit.libreoffice.org/58434 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit ab296726263655bd3a722c125dd9cec2d507aaa5) Change-Id: Id2bba5bc542875a10ac21fbb67f29b2d59705493
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/dml-textshapeB.docxbin0 -> 15148 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport6.cxx17
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport8.cxx3
3 files changed, 19 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/dml-textshapeB.docx b/sw/qa/extras/ooxmlexport/data/dml-textshapeB.docx
new file mode 100644
index 000000000000..ab790a896fd4
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/dml-textshapeB.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index a46448d4fd9e..dc82f0578093 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -114,6 +114,23 @@ DECLARE_OOXMLEXPORT_TEST(testDmlTextshape, "dml-textshape.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(-4727), xShape->getPosition().Y);
}
+DECLARE_OOXMLEXPORT_TEST(testDmlTextshapeB, "dml-textshapeB.docx")
+{
+ uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
+ xmlDocPtr pXmlDocument = parseExport("word/document.xml");
+ if (!pXmlDocument)
+ return;
+
+ uno::Reference<drawing::XShape> xShape(xGroup->getByIndex(3), uno::UNO_QUERY);
+ // Connector was incorrectly shifted towards the top left corner, X was 192, Y was -5743.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3778), xShape->getPosition().X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-5064), xShape->getPosition().Y);
+
+ xShape.set(xGroup->getByIndex(5), uno::UNO_QUERY);
+ // This was incorrectly shifted towards the top of the page, Y was -5011.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-4713), xShape->getPosition().Y);
+}
+
DECLARE_OOXMLEXPORT_TEST(testDMLSolidfillAlpha, "dml-solidfill-alpha.docx")
{
// Problem was that the transparency was not exported (a:alpha).
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 8bb8f3ecf4b5..f5a8b95e1737 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -1040,7 +1040,8 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66474, "fdo66474.docx")
DECLARE_OOXMLEXPORT_TEST(testGroupshapeRotation, "groupshape-rotation.docx")
{
// Rotation on groupshapes wasn't handled at all by the VML importer.
- CPPUNIT_ASSERT_EQUAL(sal_Int32(315 * 100), getProperty<sal_Int32>(getShape(1), "RotateAngle"));
+ // Note: the shapes are still shifting on the page, so the rotation drifts after multiple round-trips.
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(31500.0, getProperty<double>(getShape(1), "RotateAngle"), 100);
}
DECLARE_OOXMLEXPORT_TEST(testBnc780044Spacing, "bnc780044_spacing.docx")