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

fdo#56512 fix RTF import of non-unicode Hebrew text

The trick here is that we can't just fall back to Hebrew encoding for
the whole document, as that would mirror shapes as well. Instead, check
where \rtlch is used, and there fall back to the default encoding.

Change-Id: Iaf155912fab6a559ed165870b8524c23cabcb86d
üst b72fca4e
...@@ -2064,8 +2064,11 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) ...@@ -2064,8 +2064,11 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
} }
break; break;
case RTF_LTRCH: case RTF_LTRCH:
// dmapper does not support this.
break;
case RTF_RTLCH: case RTF_RTLCH:
// dmapper does not support these. if (m_aDefaultState.nCurrentEncoding == RTL_TEXTENCODING_MS_1255)
m_aStates.top().nCurrentEncoding = m_aDefaultState.nCurrentEncoding;
break; break;
case RTF_ULNONE: case RTF_ULNONE:
{ {
...@@ -2587,6 +2590,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) ...@@ -2587,6 +2590,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
} }
break; break;
case RTF_ANSICPG: case RTF_ANSICPG:
m_aDefaultState.nCurrentEncoding = rtl_getTextEncodingFromWindowsCodePage(nParam);
m_aStates.top().nCurrentEncoding = rtl_getTextEncodingFromWindowsCodePage(nParam); m_aStates.top().nCurrentEncoding = rtl_getTextEncodingFromWindowsCodePage(nParam);
break; break;
case RTF_CPG: case RTF_CPG:
......
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