From 0b20f01a8817867d7657ed2ee29321de9af15843 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 30 Jan 2014 10:25:16 +0100 Subject: swpagerelsize: implement ODF import/export Export rel-height-rel / rel-width-rel only in case rel-height / rel-width is non-zero, though. Change-Id: I36120cbd8679ac4fc072d1e7cf4dfc024836b5ac --- sw/qa/extras/odfexport/data/relh-page.odt | Bin 0 -> 10183 bytes sw/qa/extras/odfexport/data/relw-page.odt | Bin 0 -> 10221 bytes sw/qa/extras/odfexport/odfexport.cxx | 19 +++++++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 sw/qa/extras/odfexport/data/relh-page.odt create mode 100644 sw/qa/extras/odfexport/data/relw-page.odt (limited to 'sw') diff --git a/sw/qa/extras/odfexport/data/relh-page.odt b/sw/qa/extras/odfexport/data/relh-page.odt new file mode 100644 index 000000000000..2dcf6412431d Binary files /dev/null and b/sw/qa/extras/odfexport/data/relh-page.odt differ diff --git a/sw/qa/extras/odfexport/data/relw-page.odt b/sw/qa/extras/odfexport/data/relw-page.odt new file mode 100644 index 000000000000..047d91e876d5 Binary files /dev/null and b/sw/qa/extras/odfexport/data/relw-page.odt differ diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 5ef7ca408499..333f00d802de 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -13,6 +13,7 @@ #include #include #include +#include class Test : public SwModelTestBase { @@ -310,6 +311,24 @@ DECLARE_ODFEXPORT_TEST(testTextframeTransparentShadow, "textframe-transparent-sh CPPUNIT_ASSERT_EQUAL(sal_Int32(25), getProperty(xPicture, "ShadowTransparence")); } +DECLARE_ODFEXPORT_TEST(testRelhPage, "relh-page.odt") +{ + uno::Reference xTextFrame = getShape(1); + // This was text::RelOrientation::FRAME (the default), RelativeHeightRelation was not handled in xmloff. + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty(xTextFrame, "RelativeHeightRelation")); + // Make sure rel-height-rel doesn't affect width. + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty(xTextFrame, "RelativeWidthRelation")); +} + +DECLARE_ODFEXPORT_TEST(testRelwPage, "relw-page.odt") +{ + uno::Reference xTextFrame = getShape(1); + // This was text::RelOrientation::FRAME (the default), RelativeWidthRelation was not handled in xmloff. + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty(xTextFrame, "RelativeWidthRelation")); + // Make sure rel-width-rel doesn't affect height. + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty(xTextFrame, "RelativeHeightRelation")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit v1.2.3