summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-06-12 12:04:01 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-06-12 13:32:02 +0000
commit80b6b175f438dd56f6c107d956e6c00876ff3dba (patch)
tree4a43946520ba9122f5ff260da462734437614d7b
parentb56c4afb219c3ad2507af9d4eadf0c765c3bc0e0 (diff)
related: fdo#77979: writerfilter RTF import: read encoded font name
The font name is encoded in the font's charset given by \fcharset. (cherry picked from commit 04d5a280beeeb6e056df68395dc9c3b3a674361b) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx (cherry picked from commit 790df682574eb4b3da9a973c3116b54d7666837c) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: Id9520649a1eb3b55f4314e140abda7399f23d925 Reviewed-on: https://gerrit.libreoffice.org/9749 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 920b19f8108d..67285b09b3da 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -967,10 +967,6 @@ int RTFDocumentImpl::resolveChars(char ch)
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)
{
@@ -978,6 +974,9 @@ int RTFDocumentImpl::resolveChars(char ch)
Strm() >> ch;
if (m_aStates.top().nCharsToSkip == 0)
{
+ // 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.rtf", "invalid Shift-JIS without DBCH");
assert(bUnicodeChecked);
aBuf.append(ch);
}
@@ -3254,6 +3253,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
return 0;
m_aFontEncodings[m_nCurrentFontIndex] = rtl_getTextEncodingFromWindowsCodePage(aRTFEncodings[i].codepage);
+ m_aStates.top().nCurrentEncoding = m_aFontEncodings[m_nCurrentFontIndex];
}
break;
case RTF_ANSICPG:
@@ -3264,6 +3264,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
break;
case RTF_CPG:
m_aFontEncodings[m_nCurrentFontIndex] = rtl_getTextEncodingFromWindowsCodePage(nParam);
+ m_aStates.top().nCurrentEncoding = m_aFontEncodings[m_nCurrentFontIndex];
break;
case RTF_CF:
{