Kaydet (Commit) fc49c052 authored tarafından Michael Stahl's avatar Michael Stahl

writerfilter: RTF import: fix handling of associated char properties

These are all dependent on the active \lrtch \rtlch \loch \hich \dbch.

There does not appear to be a SPRM Id for CJK bold / italic / fontsize.

Change-Id: I055ac29700ccd3b32b02c3f7685629254a6c3fd6
üst 31376a31
...@@ -3354,10 +3354,11 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) ...@@ -3354,10 +3354,11 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
switch (nKeyword) switch (nKeyword)
{ {
case RTF_FS: case RTF_FS:
nSprm = NS_ooxml::LN_EG_RPrBase_sz;
break;
case RTF_AFS: case RTF_AFS:
nSprm = NS_ooxml::LN_EG_RPrBase_szCs; nSprm = (m_aStates.top().isRightToLeft
|| m_aStates.top().eRunType == RTFParserState::HICH)
? NS_ooxml::LN_EG_RPrBase_szCs
: NS_ooxml::LN_EG_RPrBase_sz;
break; break;
case RTF_ANIMTEXT: case RTF_ANIMTEXT:
nSprm = NS_ooxml::LN_EG_RPrBase_effect; nSprm = NS_ooxml::LN_EG_RPrBase_effect;
...@@ -3383,14 +3384,24 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) ...@@ -3383,14 +3384,24 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
switch (nKeyword) switch (nKeyword)
{ {
case RTF_LANG: case RTF_LANG:
nSprm = NS_ooxml::LN_CT_Language_val; case RTF_ALANG:
if (m_aStates.top().isRightToLeft || m_aStates.top().eRunType == RTFParserState::HICH)
{
nSprm = NS_ooxml::LN_CT_Language_bidi;
}
else if (m_aStates.top().eRunType == RTFParserState::DBCH)
{
nSprm = NS_ooxml::LN_CT_Language_eastAsia;
}
else
{
assert(m_aStates.top().eRunType == RTFParserState::LOCH);
nSprm = NS_ooxml::LN_CT_Language_val;
}
break; break;
case RTF_LANGFE: case RTF_LANGFE: // this one is always CJK apparently
nSprm = NS_ooxml::LN_CT_Language_eastAsia; nSprm = NS_ooxml::LN_CT_Language_eastAsia;
break; break;
case RTF_ALANG:
nSprm = NS_ooxml::LN_CT_Language_bidi;
break;
default: default:
break; break;
} }
...@@ -4593,16 +4604,18 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam ...@@ -4593,16 +4604,18 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
switch (nKeyword) switch (nKeyword)
{ {
case RTF_B: case RTF_B:
nSprm = NS_ooxml::LN_EG_RPrBase_b;
break;
case RTF_AB: case RTF_AB:
nSprm = NS_ooxml::LN_EG_RPrBase_bCs; nSprm = (m_aStates.top().isRightToLeft
|| m_aStates.top().eRunType == RTFParserState::HICH)
? NS_ooxml::LN_EG_RPrBase_bCs
: NS_ooxml::LN_EG_RPrBase_b;
break; break;
case RTF_I: case RTF_I:
nSprm = NS_ooxml::LN_EG_RPrBase_i;
break;
case RTF_AI: case RTF_AI:
nSprm = NS_ooxml::LN_EG_RPrBase_iCs; nSprm = (m_aStates.top().isRightToLeft
|| m_aStates.top().eRunType == RTFParserState::HICH)
? NS_ooxml::LN_EG_RPrBase_iCs
: NS_ooxml::LN_EG_RPrBase_i;
break; break;
case RTF_OUTL: case RTF_OUTL:
nSprm = NS_ooxml::LN_EG_RPrBase_outline; nSprm = NS_ooxml::LN_EG_RPrBase_outline;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment