summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-07-18 23:40:40 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-07-29 11:32:07 +0000
commitbd300cfba34ee8d4cc479cbbe9cf8703590c74b6 (patch)
treec375a73de1ff758920d8443062a5d4c52d61f86d /writerfilter
parent217d0ed1cdb492def7220859ecb4931d90d8022c (diff)
fdo#78502: writerfilter: RTF import: handle \u keyword inside levelnumbers
The ";" terminates an entry and shall not be inserted as text, even if some over-engineered producer encodes it as {\uc1 \u59 ?}. Also, remove the special-casing of the \leveltext destination, since the bugdoc does contain \uc inside it and it's not obvious why that should be ignored. (cherry picked from commit e93f0852477b44df986807860c821319a921b199) fdo#78502: actually empty parameter to getParagraph() is not tested (cherry picked from commit b9dca968c6fd0ab5ca140c65b0e54d153cd34986) Change-Id: I1e19c9df39597cb1b22bbda97853c829d7812e29 Reviewed-on: https://gerrit.libreoffice.org/10396 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 1210aa16d559..bdd54c7449c5 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3829,9 +3829,14 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
// static_cast() will do the right thing.
if ((SAL_MIN_INT16 <= nParam) && (nParam <= SAL_MAX_UINT16))
{
- m_aUnicodeBuffer.append(static_cast<sal_Unicode>(nParam));
- if (m_aStates.top().nDestinationState != DESTINATION_LEVELTEXT)
- m_aStates.top().nCharsToSkip = m_aStates.top().nUc;
+ if (m_aStates.top().nDestinationState == DESTINATION_LEVELNUMBERS)
+ {
+ if (nParam != ';')
+ m_aStates.top().aLevelNumbers.push_back(sal_Int32(nParam));
+ }
+ else
+ m_aUnicodeBuffer.append(static_cast<sal_Unicode>(nParam));
+ m_aStates.top().nCharsToSkip = m_aStates.top().nUc;
}
break;
case RTF_LEVELFOLLOW: