diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtftok/data/fdo50665.rtf | 16 | ||||
-rw-r--r-- | sw/qa/extras/rtftok/rtftok.cxx | 20 |
2 files changed, 36 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo50665.rtf b/sw/qa/extras/rtftok/data/fdo50665.rtf new file mode 100644 index 000000000000..2536eb0df66e --- /dev/null +++ b/sw/qa/extras/rtftok/data/fdo50665.rtf @@ -0,0 +1,16 @@ +{\rtf1\ansi\deff6 +{\fonttbl +{\f1\fnil\fprq0\fcharset0 Times New Roman;} +{\f4\fmodern\fprq1\fcharset0 Cumberland +{\*\falt Courier New} +;} +{\f6\froman\fprq2\fcharset1 Book Antiqua +{\*\falt Times New Roman} +;} +} +\sectd\sbknone\pgwsxn11909\pghsxn16834\marglsxn1080\margrsxn1080\margtsxn2437\margbsxn1080\headery1080 +\pard\plain \s7\cf0\tqr\tx9990\tqr\tx9900 +{\loch\f6\fs24\lang1033\i0\b +Page : \chpgn\par +} +} diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx index a37d02e8244b..2555fb5df2c3 100644 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ b/sw/qa/extras/rtftok/rtftok.cxx @@ -94,6 +94,7 @@ public: void testFdo49692(); void testFdo45190(); void testFdo50539(); + void testFdo50665(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -131,6 +132,7 @@ public: CPPUNIT_TEST(testFdo49692); CPPUNIT_TEST(testFdo45190); CPPUNIT_TEST(testFdo50539); + CPPUNIT_TEST(testFdo50665); #endif CPPUNIT_TEST_SUITE_END(); @@ -761,6 +763,24 @@ void Test::testFdo50539() CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), nValue); } +void Test::testFdo50665() +{ + load("fdo50665.rtf"); + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration()); + uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xRunEnum(xRunEnumAccess->createEnumeration()); + + // Access the second run, which is a textfield + xRunEnum->nextElement(); + uno::Reference<beans::XPropertySet> xRun(xRunEnum->nextElement(), uno::UNO_QUERY); + OUString aValue; + xRun->getPropertyValue("CharFontName") >>= aValue; + // This used to be the default, as character properties were ignored. + CPPUNIT_ASSERT_EQUAL(OUString("Book Antiqua"), aValue); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |