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:38:59 +0200
commit04d5a280beeeb6e056df68395dc9c3b3a674361b (patch)
tree5b77a8b80591339fd461bb176a73b72bbbfaee63
parent0b5568b9ddc2f89a58a76daef0b52bbfadcd6280 (diff)
related: fdo#77979: writerfilter RTF import: read encoded font name
The font name is encoded in the font's charset given by \fcharset. Change-Id: Id9520649a1eb3b55f4314e140abda7399f23d925
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 0608cb230db5..38bf6bbbaee3 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -980,9 +980,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)
{
@@ -990,6 +987,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);
}
@@ -3550,6 +3550,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:
@@ -3560,6 +3561,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:
{