summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-02-18 17:28:05 +0100
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-02-18 17:31:01 +0100
commitc9b1fd63452325ee5cb6d003e9fc8315d1ca104e (patch)
tree193f8c513fae4d7c6dfb0d0737dca83233ef0f28 /sw/qa
parent94af3bc2a4d729339486989fba67b17127e87329 (diff)
drawingML import: fix position of cildren in shape groups
Translate component of parent shapes' transformation have to be applied to children when there is no explicit child transformation. Note. Export also use this concept. Change-Id: I51bd3325fb53ee250402326ee361c8f07038ed07
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/dml-groupshape-childposition.docxbin0 -> 17609 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx19
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/dml-groupshape-childposition.docx b/sw/qa/extras/ooxmlexport/data/dml-groupshape-childposition.docx
new file mode 100644
index 000000000000..a5c6bf99a186
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/dml-groupshape-childposition.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 60e0f4f22014..a588ce0dee70 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3300,6 +3300,25 @@ DECLARE_OOXMLEXPORT_TEST(testFloatingTablePosition, "floating-table-position.doc
CPPUNIT_ASSERT_EQUAL(sal_Int32(8133), getProperty<sal_Int32>(xFrame, "VertOrientPosition"));
}
+DECLARE_OOXMLEXPORT_TEST(testDMLGroupShapeChildPosition, "dml-groupshape-childposition.docx")
+{
+ // Problem was parent transformation was ingnored fully, but translate component
+ // which specify the position must be also applied for children of the group.
+
+ uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY);
+ uno::Reference<drawing::XShape> xChildGroup(xGroup->getByIndex(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(m_bExported ? -2119 : -2121), xChildGroup->getPosition().X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(m_bExported ? 11338 : 11335), xChildGroup->getPosition().Y);
+
+ xGroup.set(xChildGroup, uno::UNO_QUERY);
+ xChildGroup.set(xGroup->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(m_bExported ? -1856 : -1858), xChildGroup->getPosition().X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(m_bExported ? 11338 : 11335), xChildGroup->getPosition().Y);
+
+ xChildGroup.set(xGroup->getByIndex(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(m_bExported ? -2119 : -2121), xChildGroup->getPosition().X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(m_bExported ? 14028 : 14025), xChildGroup->getPosition().Y);
+}
#endif
CPPUNIT_PLUGIN_IMPLEMENT();