diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-06-06 12:58:07 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-06-06 13:10:14 +0200 |
commit | 483c46716f269f5caf904f15676435edd8f1afd4 (patch) | |
tree | 6c1a76b040357e59f5922610ac96b13e1c339341 /sw/qa | |
parent | aa4197498a1abf53bb22843b38e827730b4d4ee1 (diff) |
fdo#50665 rtftok: don't ignore character properties of text fields
The dmapper part was already fixed in commit
9486851baea59d16c449d79bd61a38f6e686cfe0 for DOCX, this fixes the RTF
tokenizer.
Change-Id: Iaca706e50367bb744f5a03e15134bda1646df8fc
(cherry picked from commit b9508dd55f82d35f09a58021dc001cf79b390e08)
Diffstat (limited to 'sw/qa')
-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(); |