summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-02 20:14:16 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-02 20:29:00 +0200
commit6092e2eba3f74c9632f7862b2368b0fcf7732f85 (patch)
tree82d1cce1fcdb74f83cdc408e668b5ab5e5305a52 /writerfilter
parentc7c14abfd870d3849e74d379057503f16728a392 (diff)
fdo#79384 RTF import: allow { without } in style names
This is not valid, but LO 3.4 supported it, so add a workaround... Change-Id: Ib8eefdf41fe9801db6f7e5873eaa1436518912fb
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index cc99fbc8f05e..079f43ee5b1c 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -956,7 +956,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))
{