summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-02-03 14:37:38 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-02-03 14:50:19 +0100
commitf593a2e4179b05ae1019372cde612cb242d1d27f (patch)
tree90d887a1457eef3099a848dba6f8affab2968306 /writerfilter
parentc8956344af6d5ffd443b44808f34841e70ffaac0 (diff)
fdo#59419 fix RTF import of hex form of \r and \n
Change-Id: Ic700cdc67f756cafc454c326b73f680a8a47a6e8
Diffstat (limited to 'writerfilter')
-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 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)
{