diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-03-30 10:44:09 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-03-30 10:50:32 +0200 |
commit | 0827e813f9b5afcec393bad7894c4ec1954d88f1 (patch) | |
tree | c1c2e66ba72d41dff174cf0cde998aa12d1354ea /sw | |
parent | d6b806aa589683561ee5afd0895df3eb7e009085 (diff) |
testcase for fdo#45394
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtftok/data/fdo45394.rtf | 19 | ||||
-rw-r--r-- | sw/qa/extras/rtftok/rtftok.cxx | 22 |
2 files changed, 41 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo45394.rtf b/sw/qa/extras/rtftok/data/fdo45394.rtf new file mode 100644 index 000000000000..6d02f50602ce --- /dev/null +++ b/sw/qa/extras/rtftok/data/fdo45394.rtf @@ -0,0 +1,19 @@ +{\rtf1 +{\fonttbl +{\f37\fswiss\fcharset204\fprq2 +Verdana;} +} +{\headerr +\f37 \'cf\'ca \'d0\'c8\'ca\par +} +\trowd \cellx4498\cellx9104 +\pard\plain\intbl +\cell \cell +\row +\trowd \cellx4498\cellx9104 +\pard\plain\intbl +c\cell d\cell +\row +\pard\plain +\par +} diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx index 472e77566e4b..f13e15dc81b0 100644 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ b/sw/qa/extras/rtftok/rtftok.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp> #include <com/sun/star/text/XTextFramesSupplier.hpp> +#include <com/sun/star/text/XTextTablesSupplier.hpp> #include <com/sun/star/text/XTextViewCursorSupplier.hpp> #include <rtl/oustringostreaminserter.hxx> @@ -73,6 +74,7 @@ public: void testFdo47326(); void testFdo47036(); void testFdo46955(); + void testFdo45394(); CPPUNIT_TEST_SUITE(RtfModelTest); #if !defined(MACOSX) && !defined(WNT) @@ -90,6 +92,7 @@ public: CPPUNIT_TEST(testFdo47326); CPPUNIT_TEST(testFdo47036); CPPUNIT_TEST(testFdo46955); + CPPUNIT_TEST(testFdo45394); #endif CPPUNIT_TEST_SUITE_END(); @@ -449,6 +452,25 @@ void RtfModelTest::testFdo46955() } } +void RtfModelTest::testFdo45394() +{ + load(OUString(RTL_CONSTASCII_USTRINGPARAM("fdo45394.rtf"))); + + uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XNameAccess> xStyles(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY); + uno::Reference<container::XNameAccess> xPageStyles(xStyles->getByName("PageStyles"), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xPageStyles->getByName("Default"), uno::UNO_QUERY); + uno::Reference<text::XText> xHeaderText(xPropertySet->getPropertyValue("HeaderText"), uno::UNO_QUERY); + OUString aActual = xHeaderText->getString(); + // Encoding in the header was wrong. + OUString aExpected("ПК РИК", 11, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, aActual); + + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest); CPPUNIT_PLUGIN_IMPLEMENT(); |