summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-01-30 10:25:16 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-30 11:52:11 +0100
commit0b20f01a8817867d7657ed2ee29321de9af15843 (patch)
tree008e6ff80c8c4e9f9e10f974eefac739a6ab95a9 /sw/qa
parent25d089e09d94a86c615bf641d59846a65323e495 (diff)
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
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/odfexport/data/relh-page.odtbin0 -> 10183 bytes
-rw-r--r--sw/qa/extras/odfexport/data/relw-page.odtbin0 -> 10221 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx19
3 files changed, 19 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/relh-page.odt
Binary files 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
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/relw-page.odt
Binary files 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 <com/sun/star/awt/Gradient.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
+#include <com/sun/star/text/RelOrientation.hpp>
class Test : public SwModelTestBase
{
@@ -310,6 +311,24 @@ DECLARE_ODFEXPORT_TEST(testTextframeTransparentShadow, "textframe-transparent-sh
CPPUNIT_ASSERT_EQUAL(sal_Int32(25), getProperty<sal_Int32>(xPicture, "ShadowTransparence"));
}
+DECLARE_ODFEXPORT_TEST(testRelhPage, "relh-page.odt")
+{
+ uno::Reference<drawing::XShape> xTextFrame = getShape(1);
+ // This was text::RelOrientation::FRAME (the default), RelativeHeightRelation was not handled in xmloff.
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeHeightRelation"));
+ // Make sure rel-height-rel doesn't affect width.
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeWidthRelation"));
+}
+
+DECLARE_ODFEXPORT_TEST(testRelwPage, "relw-page.odt")
+{
+ uno::Reference<drawing::XShape> xTextFrame = getShape(1);
+ // This was text::RelOrientation::FRAME (the default), RelativeWidthRelation was not handled in xmloff.
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeWidthRelation"));
+ // Make sure rel-width-rel doesn't affect height.
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeHeightRelation"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();