diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-07-19 08:20:07 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-07-19 07:36:36 +0000 |
commit | 43e049c32302620bbc134732286529496853d78a (patch) | |
tree | cf767104888c2eb8bfb84ec5cf09d26a117fac5c /sw/qa/extras/rtfexport | |
parent | 8d0c103bcd84ae428b4a3cc2c48167d277b9d718 (diff) |
tdf#61901 RTF export: fix implicit font name of non-ascii text
The problem was that in case we used \loch, then \f only had an affect
on ascii characters, not on every other character range.
Change-Id: I30a851fe28131f18f5c429273a24c1424d2cec22
Reviewed-on: https://gerrit.libreoffice.org/27310
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/qa/extras/rtfexport')
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf61901.rtf | 7 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 20 |
2 files changed, 27 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf61901.rtf b/sw/qa/extras/rtfexport/data/tdf61901.rtf new file mode 100644 index 000000000000..83c4ad7a5332 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf61901.rtf @@ -0,0 +1,7 @@ +{\rtf1\ansi\deff11 +{\fonttbl +{\f11\fmodern\fcharset0 Courier New;} +{\f34\fmodern\fcharset204 Courier New Cyr;} +} +{\f34 \'c8\par} +} diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 6b0cc5c88e57..37e9ba71a099 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -1091,6 +1091,26 @@ DECLARE_RTFEXPORT_TEST(testTdf98806, "tdf98806.rtf") CPPUNIT_ASSERT_EQUAL(OUString("BBB"), xBookmark->getAnchor()->getString()); } +DECLARE_RTFEXPORT_TEST(testTdf61901, "tdf61901.rtf") +{ + // Test the file directly, as current RTF import gives the correct font name with and without the fix. + if (mbExported) + { + SvStream* pStream = maTempFile.GetStream(StreamMode::READ); + OString sLine; + while (pStream->ReadLine(sLine)) + { + sal_Int32 nIndex = sLine.indexOf("\\loch\\loch"); + if (nIndex != -1) + { + // Make sure that \hich is always written after a \loch\loch. + OString sRemaining = sLine.copy(nIndex); + CPPUNIT_ASSERT(sRemaining.indexOf("\\hich") != -1); + } + } + } +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |