diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-05-15 09:59:18 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-05-16 06:46:29 +0000 |
commit | 53d40e18515c78e59583f1f8fadc82ffa2ab9e32 (patch) | |
tree | 9026c2b72fe2853608d7ff40de198b2a8fdd44e0 /sw | |
parent | dc6c363f0c7fec8be700b272ea94eebc8e3534a9 (diff) |
fdo#62977 allow SAL_MAX_INT16..SAL_MAX_UINT16 when importing RTF_U
(cherry picked from commit 4a816a816e8b4e213394898bd0e307dd90fcbb64)
Conflicts:
sw/qa/extras/rtfimport/rtfimport.cxx
Change-Id: Ie36d5881b0ebe8c38526690ca27d02bfb7af7829
Reviewed-on: https://gerrit.libreoffice.org/3913
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfimport/data/fdo62977.rtf | 24 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 8 |
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 c02dac5db5be..bbac4786122f 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -147,6 +147,7 @@ public: void testFdo51916(); void testFdo61193(); void testFdo63023(); + void testFdo62977(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -264,6 +265,7 @@ void Test::run() {"fdo51916.rtf", &Test::testFdo51916}, {"hello.rtf", &Test::testFdo61193}, {"fdo63023.rtf", &Test::testFdo63023}, + {"fdo62977.rtf", &Test::testFdo62977}, }; for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) { @@ -1214,6 +1216,12 @@ void Test::testFdo63023() CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFF99), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xHeaderText), 1), "CharBackColor")); } +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(); |