diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2011-07-28 13:36:50 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2011-07-29 17:32:41 +0200 |
commit | 34b4d3f67b69343ff19ac489d4eafd510cc13e4b (patch) | |
tree | 60654e75f09cd1c00ced3fae40281e67f801f27a /writerfilter/source | |
parent | 5bdb2ba403f025e6a3ea8ea603625feb72a68f5f (diff) |
inherit table definition from previous row if it's missing
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 14 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index eeefbf022..b0a7a8a83 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1211,6 +1211,20 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) case RTF_ROW: case RTF_NESTROW: { + if (m_aStates.top().nCells) + { + // Make a backup before we start popping elements + m_aStates.top().aTableInheritingCellsSprms = m_aStates.top().aTableCellsSprms; + m_aStates.top().aTableInheritingCellsAttributes = m_aStates.top().aTableCellsAttributes; + m_aStates.top().nInheritingCells = m_aStates.top().nCells; + } + else + { + // No table definition? Then inherit from the previous row + m_aStates.top().aTableCellsSprms = m_aStates.top().aTableInheritingCellsSprms; + m_aStates.top().aTableCellsAttributes = m_aStates.top().aTableInheritingCellsAttributes; + m_aStates.top().nCells = m_aStates.top().nInheritingCells; + } for (int i = 0; i < m_aStates.top().nCells; ++i) { m_aStates.top().aTableCellSprms = m_aStates.top().aTableCellsSprms.front(); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 5db4bbd6f..f10a43417 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -204,6 +204,9 @@ namespace writerfilter { // reset by row/nestrow std::deque<RTFSprms> aTableCellsSprms; std::deque<RTFSprms> aTableCellsAttributes; + // backup of the above two, to support inheriting cell props + std::deque<RTFSprms> aTableInheritingCellsSprms; + std::deque<RTFSprms> aTableInheritingCellsAttributes; // reset by tx RTFSprms aTabAttributes; @@ -231,6 +234,7 @@ namespace writerfilter { /// Current cellx value. int nCellX; int nCells; + int nInheritingCells; /// CJK or CTL? bool bIsCjk; |