diff options
-rw-r--r-- | sw/qa/extras/rtftok/data/fdo39053.rtf | bin | 0 -> 22118 bytes | |||
-rw-r--r-- | sw/qa/extras/rtftok/rtftok.cxx | 21 |
2 files changed, 21 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo39053.rtf b/sw/qa/extras/rtftok/data/fdo39053.rtf Binary files differnew file mode 100644 index 000000000000..71d26916fc99 --- /dev/null +++ b/sw/qa/extras/rtftok/data/fdo39053.rtf diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx index 9fbffca7d8a5..2b5146a16ad0 100644 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ b/sw/qa/extras/rtftok/rtftok.cxx @@ -82,6 +82,7 @@ public: void testFdo45182(); void testFdo44176(); void testZoom(); + void testFdo39053(); CPPUNIT_TEST_SUITE(RtfModelTest); #if !defined(MACOSX) && !defined(WNT) @@ -105,6 +106,7 @@ public: CPPUNIT_TEST(testFdo45182); CPPUNIT_TEST(testFdo44176); CPPUNIT_TEST(testZoom); + CPPUNIT_TEST(testFdo39053); #endif CPPUNIT_TEST_SUITE_END(); @@ -548,6 +550,25 @@ void RtfModelTest::testZoom() CPPUNIT_ASSERT_EQUAL(sal_Int16(42), nValue); } +void RtfModelTest::testFdo39053() +{ + load("fdo39053.rtf"); + + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + int nAsCharacter = 0; + for (int i = 0; i < xDraws->getCount(); ++i) + { + uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(i), uno::UNO_QUERY); + text::TextContentAnchorType eValue; + xPropertySet->getPropertyValue("AnchorType") >>= eValue; + if (eValue == text::TextContentAnchorType_AS_CHARACTER) + nAsCharacter++; + } + // The image in binary format was ignored. + CPPUNIT_ASSERT_EQUAL(1, nAsCharacter); +} + CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest); CPPUNIT_PLUGIN_IMPLEMENT(); |