diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-08-17 11:38:45 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-08-17 12:30:56 +0200 |
commit | b9c1a9b9aa41dbbb6bed0c77f4370ab6105c7fb1 (patch) | |
tree | 68c3a70a739bb3ba0abeec191894140c02956ef4 /writerfilter | |
parent | 4f20c9f6f95c117bcdb520682df4fa1429a56477 (diff) |
fdo#44715 RTF import: reset styles in tables on RTF_PARD
Commit 4a507f732d82c188ad81b022cbe3037951e58ac3 added an exception to
RTF_PARD (reset paragraph properties) handling: when we're inside a
table, it should not reset the fact that we're inside a table (which is
a paragraph property).
However, instead of just re-adding that property, it disabled resetting
for all properties, and we had a growing list of exceptions since then.
The next thing to add there would be the paragraph attributes, which
contains the style information. Instead of growing that ad-hoc list,
reset everything again and just re-add the "in table" SPRM.
This makes the second and later paragraphs in the A1 cell of the bugdoc
have proper font size.
Change-Id: I2de80894fcd5da3bf45d221af9a04a307c70a29b
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 3d995c68c580..da7a81cb0229 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2268,21 +2268,17 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) if (m_bHadPicture) dispatchSymbol(RTF_PAR); // \pard is allowed between \cell and \row, but in that case it should not reset the fact that we're inside a table. + m_aStates.top().aParagraphSprms = m_aDefaultState.aParagraphSprms; + m_aStates.top().aParagraphAttributes = m_aDefaultState.aParagraphAttributes; if (m_aStates.top().nCells == 0) { - // Reset everything. - m_aStates.top().aParagraphSprms = m_aDefaultState.aParagraphSprms; - m_aStates.top().aParagraphAttributes = m_aDefaultState.aParagraphAttributes; + // Reset that we're in a table. m_aStates.top().pCurrentBuffer = 0; } else { - // Reset only margins. - lcl_eraseNestedAttribute(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_spacing, NS_ooxml::LN_CT_Spacing_before); - lcl_eraseNestedAttribute(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_spacing, NS_ooxml::LN_CT_Spacing_after); - m_aStates.top().aParagraphSprms.erase(NS_sprm::LN_PDxaLeft); - m_aStates.top().aParagraphSprms.erase(NS_sprm::LN_PDxaRight); - m_aStates.top().aParagraphSprms.erase(NS_sprm::LN_PJc); + // We are still in a table. + m_aStates.top().aParagraphSprms.set(NS_sprm::LN_PFInTable, RTFValue::Pointer_t(new RTFValue(1))); } m_aStates.top().resetFrame(); break; |