diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-06-02 23:57:13 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-04 07:35:07 +0000 |
commit | d15eb9f09c8854bd58fecd3dc6a31fa678e392a1 (patch) | |
tree | 19f8b99fd9f7fa01283599b66ab7ea74c9d3b793 /sw | |
parent | 1fd9e8e1bdf1ddf32b21d12e3793cb7a2c53e1a1 (diff) |
fdo#79384: RTF import: fix literal Shift-JIS text
This is a variable-length encoding, and the second byte may be a RTF
syntax character like \, {, }.
(cherry picked from commit 061190a62fcdbfb3a0b266d5afffbd257a3e692e)
Conflicts:
writerfilter/source/rtftok/rtfdocumentimpl.cxx
writerfilter/source/rtftok/rtfdocumentimpl.hxx
Change-Id: I813ccafda18388af3bf05eb7ce9a0253c627b1c4
Reviewed-on: https://gerrit.libreoffice.org/9632
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfimport/data/fdo79384.rtf | 9 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo79384.rtf b/sw/qa/extras/rtfimport/data/fdo79384.rtf new file mode 100644 index 000000000000..2a900852861d --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo79384.rtf @@ -0,0 +1,9 @@ +{\rtf1\ansi
+{\fonttbl{\f5\fnil\fprq0\fcharset128 OpenSymbol{\*\falt Arial Unicode MS};}}
+
+\pard\plain
+
+\dbch\f5 Mp{u y{p
+}\
+
+\par }
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 562b9dfe6e90..e8f40c85ef37 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -286,6 +286,14 @@ DECLARE_RTFIMPORT_TEST(testN751020, "n751020.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(200)), getProperty<sal_Int32>(xParaEnum->nextElement(), "ParaBottomMargin")); } +DECLARE_RTFIMPORT_TEST(testFdo79384, "fdo79384.rtf") +{ + uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); + + CPPUNIT_ASSERT_EQUAL(OUString("ΠΠ°ΡΠΊΠ΅ΡΡ ΡΠΏΠΈΡΠΊΠ°ΠΌΠ«", 31, RTL_TEXTENCODING_UTF8), + xTextRange->getString()); +} + DECLARE_RTFIMPORT_TEST(testFdo47326, "fdo47326.rtf") { // This was 15 only, as \super buffered text, then the contents of it got lost. |