From f593a2e4179b05ae1019372cde612cb242d1d27f Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Sun, 3 Feb 2013 14:37:38 +0100 Subject: fdo#59419 fix RTF import of hex form of \r and \n Change-Id: Ic700cdc67f756cafc454c326b73f680a8a47a6e8 --- writerfilter/source/rtftok/rtfdocumentimpl.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'writerfilter') diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 3aed3b4ee1fb..bc157025d493 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -945,6 +945,14 @@ void RTFDocumentImpl::singleChar(sal_uInt8 nValue, bool bRunProps) void RTFDocumentImpl::text(OUString& rString) { + if (rString.getLength() == 1) + { + // No cheating! Tokenizer ignores bare \r and \n, their hex \'0d / \'0a form doesn't count, either. + char ch = rString.getStr()[0]; + if (ch == 0x0d || ch == 0x0a) + return; + } + bool bRet = true; switch (m_aStates.top().nDestinationState) { -- cgit