diff options
author | Mark Hung <marklh9@gmail.com> | 2020-11-22 19:32:32 +0800 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-11-25 18:17:43 +0100 |
commit | efe85aa1ef4034ae70c50a256b491737199b8747 (patch) | |
tree | 873f4eca1d4f0d02d29a0aca4960173c109c2072 /writerfilter | |
parent | 711e69e333faaf0570ddf2cb1fc721bc59cc61bc (diff) |
tdf#137894 separate associated character properties
in ww8filter/RtfAttributeOutput and treat \dbch as
CJK and \hich Western in order to roundtrip the
RTF document.
ww8filter mix all the associated style, including
properties for CJK and CTL scripts.
Both RtfAttributeOutput::CharFontCJK and
RtfAttributeOutput::CharFontCTL output \dbch,
that result in incorrect assocation.
CharFontCTL should use \rtlch, but it was already in
RtfAttributeOutput::MoveCharacterProperties.
To make the order correct, I separate the
associated character properties that were
stored in m_aSyltesAssoc into m_aSyltesAssocRtlch,
and m_aSyltesAssocDbch by their script types.
Note that it is not clear what associated character
properties that we should adopt for \hich and \ltrch.
In theory RTL scripts can output high ANSI chars too,
so \hich may get properties from either Western or
CTL scripts. However, examining Hebrew RTF documents,
I didn't see any sign that \hich is used in that way.
Use RTL as CTL might be a problem for Mongolian,
Manchu and Xibe. They are CTL but top-to-bottom (aka LTR)
. But I don't think they will be expressed
as high ANSI chars either.
Change-Id: I214edbb00a67c2ffe19c5a37254c8988a0828f40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106355
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit f97af19460fbd7483a0e1c1d0137e814f5390e69)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106523
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdispatchvalue.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx index b43e85a2352a..930c613c9750 100644 --- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx +++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx @@ -164,13 +164,13 @@ bool RTFDocumentImpl::dispatchCharacterSprmValue(RTFKeyword nKeyword, int nParam case RTFParserState::RunType::HICH: case RTFParserState::RunType::RTLCH_LTRCH_1: case RTFParserState::RunType::LTRCH_RTLCH_2: - case RTFParserState::RunType::DBCH: nSprm = NS_ooxml::LN_EG_RPrBase_szCs; break; case RTFParserState::RunType::NONE: case RTFParserState::RunType::LOCH: case RTFParserState::RunType::LTRCH_RTLCH_1: case RTFParserState::RunType::RTLCH_LTRCH_2: + case RTFParserState::RunType::DBCH: default: nSprm = NS_ooxml::LN_EG_RPrBase_sz; break; @@ -762,7 +762,6 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) case RTF_AF: switch (m_aStates.top().getRunType()) { - case RTFParserState::RunType::HICH: case RTFParserState::RunType::RTLCH_LTRCH_1: case RTFParserState::RunType::LTRCH_RTLCH_2: nSprm = NS_ooxml::LN_CT_Fonts_cs; @@ -772,6 +771,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) break; case RTFParserState::RunType::NONE: case RTFParserState::RunType::LOCH: + case RTFParserState::RunType::HICH: case RTFParserState::RunType::LTRCH_RTLCH_1: case RTFParserState::RunType::RTLCH_LTRCH_2: default: |