summaryrefslogtreecommitdiff
path: root/sw/qa/extras/odfexport
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-02-08 01:50:55 +0100
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-02-08 02:59:50 +0100
commitfeae30c4ce1a1aa303500371b858f871d4ef88fc (patch)
tree114b264463bac0cb391df8c0c6af7611c91de6a2 /sw/qa/extras/odfexport
parent718203e37025fc1cc1e28f9e52f05bee79684811 (diff)
ODF export/import: text vertical adjustment attribute of text frames
ODF standard handle 'textarea-vertical-align' as a 'graphic-property' which "specifies formatting properties for chart, draw, graphic, and frame elements". So this change fit to the standard. Change-Id: I956f512953380983c2c882e943178335fd4dbfeb
Diffstat (limited to 'sw/qa/extras/odfexport')
-rw-r--r--sw/qa/extras/odfexport/data/textframe-vertadjust.odtbin0 -> 12850 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/textframe-vertadjust.odt b/sw/qa/extras/odfexport/data/textframe-vertadjust.odt
new file mode 100644
index 000000000000..bbf3416c09e1
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/textframe-vertadjust.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index c2e5c0cbbdf3..db752040e4a9 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -14,6 +14,7 @@
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
+#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
class Test : public SwModelTestBase
{
@@ -335,6 +336,20 @@ DECLARE_ODFEXPORT_TEST(testRelwPage, "relw-page.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(4896), parseDump("/root/page/body/txt/anchored/fly/infos/bounds", "width").toInt32());
}
+DECLARE_ODFEXPORT_TEST(testTextFrameVertAdjust, "textframe-vertadjust.odt")
+{
+ // Test import/export of new frame attribute called TextVerticalAdjust
+
+ // 1st frame's context is adjusted to the top
+ uno::Reference<beans::XPropertySet> xFrame(getTextFrameByName("Rectangle 1"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_TOP, getProperty<drawing::TextVerticalAdjust>(xFrame, "TextVerticalAdjust"));
+ // 2nd frame's context is adjusted to the center
+ xFrame.set(getTextFrameByName("Rectangle 2"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_CENTER, getProperty<drawing::TextVerticalAdjust>(xFrame, "TextVerticalAdjust"));
+ // 3rd frame's context is adjusted to the bottom
+ xFrame.set(getTextFrameByName("Rectangle 3"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty<drawing::TextVerticalAdjust>(xFrame, "TextVerticalAdjust"));
+}
#endif
CPPUNIT_PLUGIN_IMPLEMENT();