summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfexport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-03-27 08:23:18 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-27 08:31:44 +0100
commitddecc215614de485ab1b64812cb1b51644cad280 (patch)
treebafce7a1b3404c04cb03f42373452541f90926ba /sw/qa/extras/rtfexport
parentd87240c0b2fba39b437f87be2b3c9cf54ad0ee5f (diff)
RTF export: handle Relative{Height,Width}{,Relation}
Change-Id: I16bef12840f45b269de18fdac4c3718ed904e1be
Diffstat (limited to 'sw/qa/extras/rtfexport')
-rw-r--r--sw/qa/extras/rtfexport/data/relsize.rtf42
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx9
2 files changed, 51 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/relsize.rtf b/sw/qa/extras/rtfexport/data/relsize.rtf
new file mode 100644
index 000000000000..b32186af1849
--- /dev/null
+++ b/sw/qa/extras/rtfexport/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/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 02b2ebb35913..9251a891dbbd 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -602,6 +602,15 @@ DECLARE_RTFEXPORT_TEST(testFdo74709, "fdo74709.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(360)), getProperty<sal_Int32>(xCell, "RightBorderDistance"));
}
+DECLARE_RTFEXPORT_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"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();