diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-02 20:14:16 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-03 08:28:15 +0000 |
commit | 4cd095db39f5631379245c171e82e373833b2e11 (patch) | |
tree | 4adc353f0432b2cb74b3166f4b0aacd2bfb5a98f /writerfilter | |
parent | f03c2bb813d87bc3c89af78f7f01c587db4c59de (diff) |
fdo#79384 RTF import: allow { without } in style names
This is not valid, but LO 3.4 supported it, so add a workaround...
(cherry picked from commit 6092e2eba3f74c9632f7862b2368b0fcf7732f85)
Conflicts:
writerfilter/source/rtftok/rtfdocumentimpl.cxx
Change-Id: Ib8eefdf41fe9801db6f7e5873eaa1436518912fb
Reviewed-on: https://gerrit.libreoffice.org/9625
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 816595d598b0..e8316ffd0156 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -939,7 +939,12 @@ int RTFDocumentImpl::resolveChars(char ch) bool bUnicodeChecked = false; bool bSkipped = false; - while(!Strm().IsEof() && (m_aStates.top().nInternalState == INTERNAL_HEX || (ch != '{' && ch != '}' && ch != '\\'))) + + // Workaround for buggy input: if we're inside a style entry, then ignore + // the fact that '{' without a matching '}' is invalid. + bool bStyleEntry = m_aStates.top().nDestinationState == DESTINATION_STYLEENTRY; + + while(!Strm().IsEof() && (m_aStates.top().nInternalState == INTERNAL_HEX || ((ch != '{' || bStyleEntry) && ch != '}' && ch != '\\'))) { if (m_aStates.top().nInternalState == INTERNAL_HEX || (ch != 0x0d && ch != 0x0a)) { |