[Libreoffice-commits] .: sw/qa writerfilter/source
Miklos Vajna
vmiklos at kemper.freedesktop.org
Fri Aug 10 09:07:26 PDT 2012
sw/qa/extras/rtfimport/data/fdo48446.rtf | 7 +++++++
sw/qa/extras/rtfimport/rtfimport.cxx | 10 ++++++++++
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 3 +++
3 files changed, 20 insertions(+)
New commits:
commit f6a24ace5ad12e79f0cc90709a290a30e3758781
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Fri Aug 10 17:48:57 2012 +0200
fdo#48446 implement RTF_CPG
Change-Id: I2fb2004f2f755ce337ddd1419acf2510f17622f3
diff --git a/sw/qa/extras/rtfimport/data/fdo48446.rtf b/sw/qa/extras/rtfimport/data/fdo48446.rtf
new file mode 100644
index 0000000..9ff8f6c
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo48446.rtf
@@ -0,0 +1,7 @@
+{\rtf
+{\fonttbl
+{\f1\cpg1251 Arial;}
+}
+\f1 Èìÿ
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 0f5e704..92d306c 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -102,6 +102,7 @@ public:
void testFdo48033();
void testFdo36089();
void testFdo49892();
+ void testFdo48446();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -146,6 +147,7 @@ public:
CPPUNIT_TEST(testFdo48033);
CPPUNIT_TEST(testFdo36089);
CPPUNIT_TEST(testFdo49892);
+ CPPUNIT_TEST(testFdo48446);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -886,6 +888,14 @@ void Test::testFdo49892()
}
}
+void Test::testFdo48446()
+{
+ load("fdo48446.rtf");
+
+ OUString aExpected("ÐмÑ", 6, RTL_TEXTENCODING_UTF8);
+ getParagraph(1, aExpected);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e2c96c0..adfb18c 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2490,6 +2490,9 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
case RTF_ANSICPG:
m_aStates.top().nCurrentEncoding = rtl_getTextEncodingFromWindowsCodePage(nParam);
break;
+ case RTF_CPG:
+ m_aFontEncodings[m_nCurrentFontIndex] = rtl_getTextEncodingFromWindowsCodePage(nParam);
+ break;
case RTF_CF:
{
// NS_sprm::LN_CIco won't work, that would be an index in a static table
More information about the Libreoffice-commits
mailing list