diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-26 08:56:05 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-26 08:56:22 +0100 |
commit | e57752170e604c85a6fe8aeaa38784796e00bab1 (patch) | |
tree | 2509dd6fe4c975f570ea9a6c721a68d7449fa9a7 /writerfilter | |
parent | b4e2a13f46a247002b239d04ff3bf1d1a98d08c2 (diff) |
tdf#59454 RTF import: handle section break right before a table
DOCX import could handle this situation, as commit
2e8aad6d45c53d554ccaf26de998ede708cfc289 (fdo#39056 fdo#75431 Section
Properties if section starts with table, 2014-04-18) added support for
this situation, in case NS_ooxml::LN_tblStart/End is emitted by the
tokenizer.
Fix the problem by sending these tokens in the RTF tokenizer as well, at
least for non-nested tables.
Change-Id: Ifedb121754634529c27820dd5175e7f9e24019e1
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index d8191cff9fad..f50d355f96ce 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2136,6 +2136,15 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) { parBreak(); // Not in table? Reset max width. + if (m_nCellxMax) + { + // Was in table, but not anymore -> tblEnd. + RTFSprms aAttributes; + RTFSprms aSprms; + aSprms.set(NS_ooxml::LN_tblEnd, std::make_shared<RTFValue>(1)); + writerfilter::Reference<Properties>::Pointer_t pProperties = std::make_shared<RTFReferenceProperties>(aAttributes, aSprms); + Mapper().props(pProperties); + } m_nCellxMax = 0; } else if (m_aStates.top().eDestination != Destination::SHAPETEXT) @@ -4234,6 +4243,15 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) m_aStates.top().aTableCellAttributes = m_aDefaultState.aTableCellAttributes; // We assume text after a row definition always belongs to the table, to handle text before the real INTBL token dispatchFlag(RTF_INTBL); + if (!m_nCellxMax) + { + // Wasn't in table, but now is -> tblStart. + RTFSprms aAttributes; + RTFSprms aSprms; + aSprms.set(NS_ooxml::LN_tblStart, std::make_shared<RTFValue>(1)); + writerfilter::Reference<Properties>::Pointer_t pProperties = std::make_shared<RTFReferenceProperties>(aAttributes, aSprms); + Mapper().props(pProperties); + } m_nCellxMax = std::max(m_nCellxMax, nParam); } break; |