diff options
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/rtfimport/data/relsize.rtf | 42 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 9 |
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: */ |