Kaydet (Commit) 6092e2eb authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst c7c14abf
{\rtf1
{\stylesheet
{\*\cs35\snext35\hich\af5\dbch\af5\loch\f5 Mp{u y{p;}
}
\par }
......@@ -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))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment