diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-03-24 17:14:12 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-03-24 17:29:49 +0100 |
commit | 04cae9ec1e1f04833b06fe9f24e23cfaf5265599 (patch) | |
tree | ee987aa51e20059067c972d0faf1142b12520220 /sw/qa | |
parent | 5e994d528c67e4db1e0ef7ba01349a51acbdacb3 (diff) |
fdo#46955 fix RTF import of all capitals char prop
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/rtftok/rtftok.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx index 0628268b9267..472e77566e4b 100644 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ b/sw/qa/extras/rtftok/rtftok.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/style/CaseMap.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/table/BorderLineStyle.hpp> @@ -71,6 +72,7 @@ public: void testN751020(); void testFdo47326(); void testFdo47036(); + void testFdo46955(); CPPUNIT_TEST_SUITE(RtfModelTest); #if !defined(MACOSX) && !defined(WNT) @@ -87,6 +89,7 @@ public: CPPUNIT_TEST(testN751020); CPPUNIT_TEST(testFdo47326); CPPUNIT_TEST(testFdo47036); + CPPUNIT_TEST(testFdo46955); #endif CPPUNIT_TEST_SUITE_END(); @@ -425,6 +428,27 @@ void RtfModelTest::testFdo47036() CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount()); } +void RtfModelTest::testFdo46955() +{ + load(OUString(RTL_CONSTASCII_USTRINGPARAM("fdo46955.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(); + while (xParaEnum->hasMoreElements()) + { + uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration(); + while (xRangeEnum->hasMoreElements()) + { + uno::Reference<beans::XPropertySet> xPropertySet(xRangeEnum->nextElement(), uno::UNO_QUERY); + sal_Int16 nValue; + xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharCaseMap"))) >>= nValue; + CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, nValue); + } + } +} + CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest); CPPUNIT_PLUGIN_IMPLEMENT(); |