summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-02-03 14:37:38 +0100
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-02-04 05:34:05 +0000
commit285c71000aece675f982e8c637f202e606522daf (patch)
treeaead3facd252f1e8f7ccb928dcd1f35de150b3b8
parent9b70bf62e6b5319e282cd3533c90216aabccfe53 (diff)
fdo#59419 fix RTF import of hex form of \r and \n
(cherry picked from commits a5e885df24eb11c028a94ac709966b3ce2976db9 and 927de8786850936bb42c5595c41a4353c076fdea) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: Ic700cdc67f756cafc454c326b73f680a8a47a6e8 Reviewed-on: https://gerrit.libreoffice.org/1974 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index c961c7dacdf0..37d037638b2e 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -944,6 +944,14 @@ void RTFDocumentImpl::singleChar(sal_uInt8 nValue, bool bRunProps)
void RTFDocumentImpl::text(OUString& rString)
{
+ if (rString.getLength() == 1 && m_aStates.top().nDestinationState != DESTINATION_DOCCOMM)
+ {
+ // No cheating! Tokenizer ignores bare \r and \n, their hex \'0d / \'0a form doesn't count, either.
+ sal_Unicode ch = rString.getStr()[0];
+ if (ch == 0x0d || ch == 0x0a)
+ return;
+ }
+
bool bRet = true;
switch (m_aStates.top().nDestinationState)
{