summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-06-12 12:04:01 +0200
committerMichael Stahl <mstahl@redhat.com>2014-06-12 12:44:47 +0200
commit790df682574eb4b3da9a973c3116b54d7666837c (patch)
treee54d0e450ddd658d1284b2bf3e8bc97240b8eb6a
parentb9d6da2f3d135cc314bf14829b2a85ce0ca6319d (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 Change-Id: Id9520649a1eb3b55f4314e140abda7399f23d925
-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 c5cf23fd644c..b83c74a8a7ad 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -984,10 +984,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.rtf", "invalid Shift-JIS without DBCH");
unsigned char uch = ch;
if ((uch >= 0x80 && uch <= 0x9F) || uch >= 0xE0)
{
@@ -995,6 +991,9 @@ int RTFDocumentImpl::resolveChars(char ch)
Strm().ReadChar(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);
}
@@ -3557,6 +3556,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
return 0;
m_nCurrentEncoding = rtl_getTextEncodingFromWindowsCodePage(aRTFEncodings[i].codepage);
+ m_aStates.top().nCurrentEncoding = m_nCurrentEncoding;
}
break;
case RTF_ANSICPG:
@@ -3567,6 +3567,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
break;
case RTF_CPG:
m_nCurrentEncoding = rtl_getTextEncodingFromWindowsCodePage(nParam);
+ m_aStates.top().nCurrentEncoding = m_nCurrentEncoding;
break;
case RTF_CF:
{