sw/qa/extras/rtftok/data/fdo45394.rtf | 19 +++++++++++++++++++ sw/qa/extras/rtftok/rtftok.cxx | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+)
New commits: commit 0827e813f9b5afcec393bad7894c4ec1954d88f1 Author: Miklos Vajna <vmik...@suse.cz> Date: Fri Mar 30 10:44:09 2012 +0200 testcase for fdo#45394 diff --git a/sw/qa/extras/rtftok/data/fdo45394.rtf b/sw/qa/extras/rtftok/data/fdo45394.rtf new file mode 100644 index 0000000..6d02f50 --- /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 472e775..f13e15d 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();
_______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits