summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-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();