summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-10-30 16:41:24 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-10-30 17:42:34 +0100
commitb99b91763f96dcd5ff24c2d4cd9233a493b58aa0 (patch)
tree81d74ca9b55fdf61599dc049446684f75230e40d
parentb72fca4ec4ad00786192bad68eba245cdeb6a692 (diff)
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
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index f350a7f06458..2333f5263405 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -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: