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 | a42629233f7feaa6afb61e02a65399d2c365bfcf (patch) | |
tree | db524136cc53e0184e164be82e287cc6d68eae36 /writerfilter | |
parent | Support table definition at the start of the row (diff) | |
download | core-a42629233f7feaa6afb61e02a65399d2c365bfcf.tar.gz core-a42629233f7feaa6afb61e02a65399d2c365bfcf.zip |
inherit table definition from previous row if it's missing
Diffstat (limited to 'writerfilter')
-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 eeefbf0225cb..b0a7a8a83f97 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 5db4bbd6f67d..f10a43417d5f 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; |