Kaydet (Commit) 9f15592e authored tarafından Miklos Vajna's avatar Miklos Vajna

fdo#41034 improve RTF import of table cell spacings

1) for empty cells, not only paragraph properties, but but character properties should be emitted as well (e.g. font)
2) \sb and \sb is an attribute, not an sprm (it was ignored)
3) \sl was ~ignored due to a typo
üst 15fd86b9
...@@ -1348,9 +1348,11 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) ...@@ -1348,9 +1348,11 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
{ {
if (m_bNeedPap) if (m_bNeedPap)
{ {
// There were no runs in the cell, so we need to send paragraph properties here. // There were no runs in the cell, so we need to send paragraph and character properties here.
RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms)); RTFValue::Pointer_t pPValue(new RTFValue(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms));
m_aTableBuffer.push_back(make_pair(BUFFER_PROPS, pValue)); m_aTableBuffer.push_back(make_pair(BUFFER_PROPS, pPValue));
RTFValue::Pointer_t pCValue(new RTFValue(m_aStates.top().aCharacterAttributes, m_aStates.top().aCharacterSprms));
m_aTableBuffer.push_back(make_pair(BUFFER_PROPS, pCValue));
} }
RTFValue::Pointer_t pValue; RTFValue::Pointer_t pValue;
...@@ -1964,8 +1966,6 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) ...@@ -1964,8 +1966,6 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
case RTF_LIN: nSprm = 0x845e; break; case RTF_LIN: nSprm = 0x845e; break;
case RTF_RI: nSprm = NS_sprm::LN_PDxaRight; break; case RTF_RI: nSprm = NS_sprm::LN_PDxaRight; break;
case RTF_RIN: nSprm = 0x845d; break; case RTF_RIN: nSprm = 0x845d; break;
case RTF_SB: nSprm = NS_sprm::LN_PDyaBefore; break;
case RTF_SA: nSprm = NS_sprm::LN_PDyaAfter; break;
case RTF_ITAP: nSprm = NS_sprm::LN_PTableDepth; break; case RTF_ITAP: nSprm = NS_sprm::LN_PTableDepth; break;
default: break; default: break;
} }
...@@ -1983,6 +1983,8 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) ...@@ -1983,6 +1983,8 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
{ {
case RTF_SBASEDON: nSprm = NS_rtf::LN_ISTDBASE; break; case RTF_SBASEDON: nSprm = NS_rtf::LN_ISTDBASE; break;
case RTF_SNEXT: nSprm = NS_rtf::LN_ISTDNEXT; break; case RTF_SNEXT: nSprm = NS_rtf::LN_ISTDNEXT; break;
case RTF_SB: nSprm = NS_ooxml::LN_CT_Spacing_before; break;
case RTF_SA: nSprm = NS_ooxml::LN_CT_Spacing_after; break;
default: break; default: break;
} }
if (nSprm > 0) if (nSprm > 0)
...@@ -2172,7 +2174,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) ...@@ -2172,7 +2174,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
if (nParam > 0) if (nParam > 0)
{ {
// NS_sprm::LN_PDyaLine could be used, but that won't work with slmult // NS_sprm::LN_PDyaLine could be used, but that won't work with slmult
m_aStates.top().aParagraphAttributes->push_back(make_pair(nSprm, pIntValue)); m_aStates.top().aParagraphAttributes->push_back(make_pair(NS_ooxml::LN_CT_Spacing_line, pIntValue));
} }
break; break;
case RTF_SLMULT: case RTF_SLMULT:
......
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