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
This commit is contained in:
@@ -2064,8 +2064,11 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
|
||||
}
|
||||
break;
|
||||
case RTF_LTRCH:
|
||||
// dmapper does not support this.
|
||||
break;
|
||||
case RTF_RTLCH:
|
||||
// dmapper does not support these.
|
||||
if (m_aDefaultState.nCurrentEncoding == RTL_TEXTENCODING_MS_1255)
|
||||
m_aStates.top().nCurrentEncoding = m_aDefaultState.nCurrentEncoding;
|
||||
break;
|
||||
case RTF_ULNONE:
|
||||
{
|
||||
@@ -2587,6 +2590,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
|
||||
}
|
||||
break;
|
||||
case RTF_ANSICPG:
|
||||
m_aDefaultState.nCurrentEncoding = rtl_getTextEncodingFromWindowsCodePage(nParam);
|
||||
m_aStates.top().nCurrentEncoding = rtl_getTextEncodingFromWindowsCodePage(nParam);
|
||||
break;
|
||||
case RTF_CPG:
|
||||
|
Reference in New Issue
Block a user