summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-01-30 14:33:44 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-30 14:58:23 +0100
commitda5b9bc95c32bd233595a28bd276f8ed1f4fc859 (patch)
tree2e9ea2038d242921ae35a1f6c733fba6ec211663 /sw
parente63923b0334ae381e0fcc576a6b6e08a62e657cf (diff)
DOCX import of wp14:sizeRelH/V relativeFrom="page"
Change-Id: Idd9dcc60f415081cb7a727b46a89d45af04465d0
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/ooxmlimport/data/pagerelsize.docxbin0 -> 17318 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx14
2 files changed, 13 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/pagerelsize.docx b/sw/qa/extras/ooxmlimport/data/pagerelsize.docx
new file mode 100755
index 000000000000..3b6c1ff448b4
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/pagerelsize.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index ab69ced00697..bfcaa267549d 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1734,9 +1734,21 @@ DECLARE_OOXMLIMPORT_TEST(testDMLGroupshapeSdt, "dml-groupshape-sdt.docx")
// The text in the groupshape was missing due to the w:sdt and w:sdtContent wrapper around it.
CPPUNIT_ASSERT_EQUAL(OUString("sdt and sdtContent inside groupshape"), uno::Reference<text::XTextRange>(xGroupShape->getByIndex(1), uno::UNO_QUERY)->getString());
}
-#endif
+DECLARE_OOXMLIMPORT_TEST(testPageRelSize, "pagerelsize.docx")
+{
+ // First textframe: width is relative from page, but not height.
+ uno::Reference<drawing::XShape> xTextFrame = getShape(1);
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeWidthRelation"));
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeHeightRelation"));
+ // Second textframe: height is relative from page, but not height.
+ xTextFrame = getShape(2);
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeHeightRelation"));
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeWidthRelation"));
+}
+
+#endif
CPPUNIT_PLUGIN_IMPLEMENT();