diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-06-03 19:32:10 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-06-03 20:55:30 +0200 |
commit | 1063b8e8c122a819e844a2209a7136a8a9be31fd (patch) | |
tree | 9badc4134281a378bd598c6a33591c3ad236154c /writerfilter | |
parent | 8cd856d9705fbcd61ad902859769fc98bf6d7a69 (diff) |
fdo#79384: replace the work-around with a different one
Word will reject Shift-JIS following \loch, but apparently OOo could read
and (worse) write such documents, so accept Shift-JIS regardless of run
charset type.
Change-Id: Ib181956e9f218548a52037dd76fa1d3ecdc006bd
(cherry picked from commit d71387ca81b61416b9a7b82cd6cf67d496b81fc2)
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index cf989c79f2d2..7c99b85aa00d 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -957,11 +957,8 @@ int RTFDocumentImpl::resolveChars(char ch) bool bUnicodeChecked = false; bool bSkipped = false; - // 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 != '\\'))) + while (!Strm().IsEof() && (m_aStates.top().nInternalState == INTERNAL_HEX + || (ch != '{' && ch != '}' && ch != '\\'))) { if (m_aStates.top().nInternalState == INTERNAL_HEX || (ch != 0x0d && ch != 0x0a)) { @@ -985,9 +982,12 @@ int RTFDocumentImpl::resolveChars(char ch) if (m_aStates.top().nInternalState == INTERNAL_HEX) break; - if (RTFParserState::DBCH == m_aStates.top().eRunType && - RTL_TEXTENCODING_MS_932 == m_aStates.top().nCurrentEncoding) + if (RTL_TEXTENCODING_MS_932 == m_aStates.top().nCurrentEncoding) { + // fdo#79384: Word will reject Shift-JIS following \loch + // but apparently OOo could read and (worse) write such documents + SAL_INFO_IF(m_aStates.top().eRunType != RTFParserState::DBCH, + "writerfilter.rtftok", "invalid Shift-JIS without DBCH"); unsigned char uch = ch; if ((uch >= 0x80 && uch <= 0x9F) || uch >= 0xE0) { |