summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-03-26 11:43:31 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-26 11:53:09 +0100
commitbc5060b32f08b0408fb929faea1f8140a58d3cc5 (patch)
treeec932bb9c98a8851fac732ae37709334c4cd9545 /sw
parent3952fab4edb68608dee1e20750a826c6e0c1a417 (diff)
RTF import: handle Relative{Height,Width}{,Relation}
Change-Id: Ic3a578af9c0808b188a4d196b1c132c0b23f15f7
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/relsize.rtf42
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx9
2 files changed, 51 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/relsize.rtf b/sw/qa/extras/rtfimport/data/relsize.rtf
new file mode 100644
index 000000000000..b32186af1849
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/relsize.rtf
@@ -0,0 +1,42 @@
+{\rtf1
+\paperw12240\paperh15840\margl1417\margr1417\margt1417\margb1417
+\pard\plain
+{\rtlch
+{\shp
+{\*\shpinst\shpleft0\shptop0\shpright3739\shpbottom2211\shpwr2\shpwrk0\shpfblwtxt0\shpz0
+{\sp
+{\sn shapeType}
+{\sv 202}
+}
+{\sp
+{\sn posh}
+{\sv 2}
+}
+{\sp
+{\sn dhgt}
+{\sv 251659264}
+}
+{\sp
+{\sn fBehindDocument}
+{\sv 0}
+}
+{\sp
+{\sn pctHoriz}
+{\sv 400}
+}
+{\sp
+{\sn pctVert}
+{\sv 200}
+}
+{\sp
+{\sn sizerelv}
+{\sv 0}
+}
+{\shptxt Textbox text.
+\par}
+}
+}
+}
+{Relative height: 20%, margin.\par}
+{Relative width: 40%, page.\par}
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index cb19476e9d64..738d1e2558c6 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1619,6 +1619,15 @@ DECLARE_RTFIMPORT_TEST(testDprectAnchor, "dprect-anchor.rtf")
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
}
+DECLARE_RTFIMPORT_TEST(testRelsize, "relsize.rtf")
+{
+ uno::Reference<drawing::XShape> xShape = getShape(1);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(40), getProperty<sal_Int16>(xShape, "RelativeWidth"));
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xShape, "RelativeWidthRelation"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(20), getProperty<sal_Int16>(xShape, "RelativeHeight"));
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xShape, "RelativeHeightRelation"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */