summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-05-15 09:59:18 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-05-15 10:30:37 +0200
commit4a816a816e8b4e213394898bd0e307dd90fcbb64 (patch)
tree762499fd1fb6ade7faeea9072da3422995b59c1c /sw/qa/extras
parentafeabb04605c3280326e78a4dee3511f21710604 (diff)
fdo#62977 allow SAL_MAX_INT16..SAL_MAX_UINT16 when importing RTF_U
Change-Id: Ie36d5881b0ebe8c38526690ca27d02bfb7af7829
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/rtfimport/data/fdo62977.rtf24
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx8
2 files changed, 32 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo62977.rtf b/sw/qa/extras/rtfimport/data/fdo62977.rtf
new file mode 100644
index 000000000000..f16135d81a72
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo62977.rtf
@@ -0,0 +1,24 @@
+{\rtf1 \ansi
+{\fonttbl;
+{
+\f0 \'41\'72\'69\'61\'6c;}
+{
+\f1 \'53\'79\'6d\'62\'6f\'6c;}
+{
+\f2 \'54\'69\'6d\'65\'73\'20\'4e\'65\'77\'20\'52\'6f\'6d\'61\'6e;}
+{
+\f3 \'82\'6c\'82\'72\'20\'96\'be\'92\'a9;}
+}
+{\*\generator Apache XML Graphics RTF Library;}
+\fet0 \ftnbj \paperw11905 \paperh16837 \margt1984 \margb1700 \margl1700 \margr1700 \itap0 \sectd \headery720 \footery720 \stextflow0 \cols1
+{\ri0 \li0
+{\qr \b0 \fi0 \cf1 \loch\af3 \hich\af3 \dbch\f3 \ri0 \sl420 \i0 \li0 \fs21
+{\b0 \cf1 \loch\af3 \hich\af3 \dbch\f3 \i0 \fs21
+{\strike0 \b0 \cf1 \loch\af3 \hich\af3 \dbch\f3 \ul0 \i0 \fs21 \sa0 \sb0
+\u24180\'3f\u65300\'3f\u26376\'3f
+\par
+}
+}
+}
+}
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index f8c8a2fe3d09..d2ccfbae100a 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -134,6 +134,7 @@ public:
void testFdo61193();
void testFdo63023();
void testFdo42109();
+ void testFdo62977();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -257,6 +258,7 @@ void Test::run()
{"hello.rtf", &Test::testFdo61193},
{"fdo63023.rtf", &Test::testFdo63023},
{"fdo42109.rtf", &Test::testFdo42109},
+ {"fdo62977.rtf", &Test::testFdo62977},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1224,6 +1226,12 @@ void Test::testFdo42109()
CPPUNIT_ASSERT_EQUAL(OUString("TextField"), getProperty<OUString>(getRun(getParagraphOfText(1, xCell->getText()), 1), "TextPortionType"));
}
+void Test::testFdo62977()
+{
+ // The middle character was imported as '?' instead of the proper unicode value.
+ getRun(getParagraph(1), 1, OUString("\xE5\xB9\xB4\xEF\xBC\x94\xE6\x9C\x88", 9, RTL_TEXTENCODING_UTF8));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();