summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-03 15:02:57 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-03 16:15:10 +0200
commit2cbd2abf1c26639edde6e0f9823e349b6edfab79 (patch)
tree4b7e97504d1c59fe5d6fda53aafbd98833345999 /sw/qa
parent445b58a829ecc3868b79997480958571312cbc4a (diff)
ODF loext:text-box import/export testcase
There is a lot more to test here, but for now just test that we can have tables and rounded corners at the same time. Change-Id: Ia9a4877202d1d040209f49a428b83633c58fc7c7
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/odfexport/data/textbox-rounded-corners.odtbin0 -> 13260 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx15
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/textbox-rounded-corners.odt b/sw/qa/extras/odfexport/data/textbox-rounded-corners.odt
new file mode 100644
index 000000000000..385185021ab3
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/textbox-rounded-corners.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 128443542bdd..b5010bf7da3b 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -364,6 +364,21 @@ DECLARE_ODFEXPORT_TEST(testShapeRelsize, "shape-relsize.odt")
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xShape, "RelativeHeightRelation"));
}
+DECLARE_ODFEXPORT_TEST(testTextboxRoundedCorners, "textbox-rounded-corners.odt")
+{
+ uno::Reference<drawing::XShape> xShape = getShape(1);
+ comphelper::SequenceAsHashMap aCustomShapeGeometry = comphelper::SequenceAsHashMap(getProperty< uno::Sequence<beans::PropertyValue> >(xShape, "CustomShapeGeometry"));
+
+ // Test that the shape is a rounded rectangle.
+ CPPUNIT_ASSERT_EQUAL(OUString("round-rectangle"), aCustomShapeGeometry["Type"].get<OUString>());
+
+ // The shape text should start with a table, with "a" in its A1 cell.
+ uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
+ uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1, xText), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("a"), xCell->getString());
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();