summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfimport
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-06-02 23:57:13 +0200
committerMichael Stahl <mstahl@redhat.com>2014-06-03 20:48:43 +0200
commit061190a62fcdbfb3a0b266d5afffbd257a3e692e (patch)
tree585e1007fbf7dbf897657f128880f8860ae8c092 /sw/qa/extras/rtfimport
parent96840ff0ce697c5c05b59d53409b3cf27ac35e5f (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 \, {, }. Change-Id: I813ccafda18388af3bf05eb7ce9a0253c627b1c4
Diffstat (limited to 'sw/qa/extras/rtfimport')
-rw-r--r--sw/qa/extras/rtfimport/data/fdo79384.rtf9
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx8
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 „M„p„‚„{„u„‚„ „ƒ„„y„ƒ„{„p
+„}„\
+
+\par }
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index b9ea9d8c8aad..165492247598 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -290,6 +290,14 @@ DECLARE_RTFIMPORT_TEST(testN751020, "n751020.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(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.