[Libreoffice-commits] .: sw/qa writerfilter/source
Miklos Vajna
vmiklos at kemper.freedesktop.org
Sat Mar 24 09:29:31 PDT 2012
sw/qa/extras/rtftok/rtftok.cxx | 24 ++++++++++++++++++++++++
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 1 +
2 files changed, 25 insertions(+)
New commits:
commit 04cae9ec1e1f04833b06fe9f24e23cfaf5265599
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Sat Mar 24 17:14:12 2012 +0100
fdo#46955 fix RTF import of all capitals char prop
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 0628268..472e775 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();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e4d4e50..85f70f9 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2768,6 +2768,7 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
case RTF_STRIKED: nSprm = NS_sprm::LN_CFDStrike; break;
case RTF_SCAPS: nSprm = NS_sprm::LN_CFSmallCaps; break;
case RTF_IMPR: nSprm = NS_sprm::LN_CFImprint; break;
+ case RTF_CAPS: nSprm = NS_sprm::LN_CFCaps; break;
default: break;
}
if (nSprm >= 0)
More information about the Libreoffice-commits
mailing list