[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Jun 2 13:19:53 PDT 2014
sw/qa/core/data/rtf/pass/fdo79384.rtf | 5 +++++
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
New commits:
commit b7b3035ff14ba78ee193a0d5e83c9b028bf06b84
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jun 2 20:14:16 2014 +0200
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)
Change-Id: Ib8eefdf41fe9801db6f7e5873eaa1436518912fb
diff --git a/sw/qa/core/data/rtf/pass/fdo79384.rtf b/sw/qa/core/data/rtf/pass/fdo79384.rtf
new file mode 100644
index 0000000..84875a9
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/fdo79384.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+{\stylesheet
+{\*\cs35\snext35\hich\af5\dbch\af5\loch\f5 Mp{u y{p;}
+}
+\par }
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index d66b668..6869014 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))
{
More information about the Libreoffice-commits
mailing list