[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - writerfilter/source
Michael Stahl
mstahl at redhat.com
Thu Jun 12 06:32:28 PDT 2014
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 80b6b175f438dd56f6c107d956e6c00876ff3dba
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Jun 12 12:04:01 2014 +0200
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 920b19f..67285b0 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:
{
More information about the Libreoffice-commits
mailing list