diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-02-27 11:19:38 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-02-27 11:21:55 +0100 |
commit | bb4ceaa4bbe253f4d6b22b09098de0f2f0b793c8 (patch) | |
tree | 75da2666929628b3eefaad8a3c11388a2d24a834 /sw/qa/extras | |
parent | 8e750a2d9c653e0693738c847fe2ee2a8ab04052 (diff) |
add testcase for fdo#45187
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/rtftok/data/fdo45187.rtf | 32 | ||||
-rw-r--r-- | sw/qa/extras/rtftok/rtftok.cxx | 22 |
2 files changed, 54 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo45187.rtf b/sw/qa/extras/rtftok/data/fdo45187.rtf new file mode 100644 index 000000000000..61b71ade8082 --- /dev/null +++ b/sw/qa/extras/rtftok/data/fdo45187.rtf @@ -0,0 +1,32 @@ +{\rtf1 +{\field +{\*\fldinst SHAPE } +{\fldrslt +{\shp +{\*\shpinst\shpleft1000\shptop1000\shpright2000\shpbottom2000 +{\sp +{\sn shapeType} +{\sv 1} +} +} +} +} +} +first +\par +{\field +{\*\fldinst SHAPE } +{\fldrslt +{\shp +{\*\shpinst\shpleft1000\shptop3000\shpright2000\shpbottom4000 +{\sp +{\sn shapeType} +{\sv 3} +} +} +} +} +} +second +\par +} diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx index 92c32294e794..0e4a31b52ba6 100644 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ b/sw/qa/extras/rtftok/rtftok.cxx @@ -59,6 +59,7 @@ public: void testFdo45543(); void testN695479(); void testFdo42465(); + void testFdo45187(); CPPUNIT_TEST_SUITE(RtfModelTest); #if !defined(MACOSX) && !defined(WNT) @@ -67,6 +68,7 @@ public: CPPUNIT_TEST(testFdo45543); CPPUNIT_TEST(testN695479); CPPUNIT_TEST(testFdo42465); + CPPUNIT_TEST(testFdo45187); #endif CPPUNIT_TEST_SUITE_END(); @@ -244,6 +246,26 @@ void RtfModelTest::testFdo42465() CPPUNIT_ASSERT_EQUAL(3, getLength()); } +void RtfModelTest::testFdo45187() +{ + load(OUString(RTL_CONSTASCII_USTRINGPARAM("fdo45187.rtf"))); + + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + // There should be two shapes. + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDraws->getCount()); + // They should be anchored to different paragraphs. + uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); + uno::Any aValue = xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnchorPosition"))); + awt::Point aFirstPoint; + aValue >>= aFirstPoint; + xPropertySet.set(xDraws->getByIndex(1), uno::UNO_QUERY); + aValue = xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnchorPosition"))); + awt::Point aSecondPoint; + aValue >>= aSecondPoint; + CPPUNIT_ASSERT(aFirstPoint.Y != aSecondPoint.Y); +} + CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest); CPPUNIT_PLUGIN_IMPLEMENT(); |