diff options
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/rtftok/data/fdo45182.rtf | 11 | ||||
-rw-r--r-- | sw/qa/extras/rtftok/rtftok.cxx | 15 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo45182.rtf b/sw/qa/extras/rtftok/data/fdo45182.rtf new file mode 100644 index 000000000000..b076106162b7 --- /dev/null +++ b/sw/qa/extras/rtftok/data/fdo45182.rtf @@ -0,0 +1,11 @@ +{\rtf1\deff0 +{\fonttbl +{\f0\fcharset238 +Times New Roman;} +} +a\chftn +{\footnote +\ltrpar \pard\plain\'9eivnost\'ed +\par +} +} diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx index 45eabbf62e0d..926796799f82 100644 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ b/sw/qa/extras/rtftok/rtftok.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/text/SizeType.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> +#include <com/sun/star/text/XFootnotesSupplier.hpp> #include <com/sun/star/text/XPageCursor.hpp> #include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp> @@ -77,6 +78,7 @@ public: void testFdo45394(); void testFdo48104(); void testFdo47107(); + void testFdo45182(); CPPUNIT_TEST_SUITE(RtfModelTest); #if !defined(MACOSX) && !defined(WNT) @@ -97,6 +99,7 @@ public: CPPUNIT_TEST(testFdo45394); CPPUNIT_TEST(testFdo48104); CPPUNIT_TEST(testFdo47107); + CPPUNIT_TEST(testFdo45182); #endif CPPUNIT_TEST_SUITE_END(); @@ -500,6 +503,18 @@ void RtfModelTest::testFdo47107() xNumberingStyles->getByName("WWNum2"); } +void RtfModelTest::testFdo45182() +{ + load("fdo45182.rtf"); + + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY); + // Encoding in the footnote was wrong. + OUString aExpected("živností", 10, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest); CPPUNIT_PLUGIN_IMPLEMENT(); |