diff options
author | Andras Timar <andras.timar@collabora.com> | 2014-11-24 11:33:17 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-12-13 16:00:36 +0100 |
commit | cfd5ceb052841c6881cd22db87b5e181645f798b (patch) | |
tree | 59ea61aae8b801a034b06b9a82867ec13ef7fc95 /sw | |
parent | 6d7dff3609df437a2d0767cf8dcc433019529308 (diff) |
fdo#85889 handle pc, pca and mac rtf keywords in writerfilter
(cherry picked from commit 7839633fb356285652ed96f4bf3f85bcd5b561a4)
Conflicts:
sw/qa/extras/rtfimport/rtfimport.cxx
Change-Id: Ic54f2233a37562bdc516e440af0b4b7973f56342
Reviewed-on: https://gerrit.libreoffice.org/13106
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/fdo85889-mac.rtf | 3 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/data/fdo85889-pc.rtf | 3 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/data/fdo85889-pca.rtf | 3 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 26 |
4 files changed, 35 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo85889-mac.rtf b/sw/qa/extras/rtfimport/data/fdo85889-mac.rtf new file mode 100644 index 000000000000..8056d47aacce --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo85889-mac.rtf @@ -0,0 +1,3 @@ +{\rtf1\mac \deff0{\fonttbl{\f0\fmodern Helvetica;}} +\pard\f0\fs20 \'f1\'f2\'f3\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo85889-pc.rtf b/sw/qa/extras/rtfimport/data/fdo85889-pc.rtf new file mode 100644 index 000000000000..a3b9d2745397 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo85889-pc.rtf @@ -0,0 +1,3 @@ +{\rtf1\pc \deff0{\fonttbl{\f0\fmodern Helvetica;}} +\pard\f0\fs20 \'f1\'f2\'f3\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo85889-pca.rtf b/sw/qa/extras/rtfimport/data/fdo85889-pca.rtf new file mode 100644 index 000000000000..34eeb18ef29d --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo85889-pca.rtf @@ -0,0 +1,3 @@ +{\rtf1\pca \deff0{\fonttbl{\f0\fmodern Helvetica;}} +\pard\f0\fs20 \'f1\'f2\'f3\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 9a274fdcd634..bf4b176f51ca 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2023,6 +2023,32 @@ DECLARE_RTFIMPORT_TEST(testFdo83204, "fdo83204.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty<OUString>(getParagraph(1), "ParaStyleName")); } + +DECLARE_RTFIMPORT_TEST(testFdo85889pc, "fdo85889-pc.rtf") +{ + uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); + + OUString aExpected("\xc2\xb1\xe2\x89\xa5\xe2\x89\xa4", 8, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + +DECLARE_RTFIMPORT_TEST(testFdo85889pca, "fdo85889-pca.rtf") +{ + uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); + + OUString aExpected("\xc2\xb1\xe2\x80\x97\xc2\xbe", 7, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + +DECLARE_RTFIMPORT_TEST(testFdo85889mac, "fdo85889-mac.rtf") +{ + uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); + + OUString aExpected("\xc3\x92\xc3\x9a\xc3\x9b", 6, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |