diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2014-01-13 11:44:28 +0100 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2014-01-13 11:44:28 +0100 |
commit | a70b8584d2fea1d6e309ef7e4f6711cb217b7388 (patch) | |
tree | 898bee9e1b0483728e43bdf27b5f3cea9b043ca0 | |
parent | c0437e7a7d6d3e1118158cbece01c12dfe2ed023 (diff) |
It seems that AbiWord gets the real number of columns in the table this waylibabw-0.0.0
-rw-r--r-- | src/lib/ABWContentCollector.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/lib/ABWContentCollector.cpp b/src/lib/ABWContentCollector.cpp index 8d7c36c..b32db89 100644 --- a/src/lib/ABWContentCollector.cpp +++ b/src/lib/ABWContentCollector.cpp @@ -1241,16 +1241,19 @@ void libabw::ABWContentCollector::_openTable() m_ps->m_deferredPageBreak = false; m_ps->m_deferredColumnBreak = false; + WPXPropertyListVector tmpColumns; + parseTableColumns(_findTableProperty("table-column-props"), tmpColumns); + unsigned numColumns = tmpColumns.count(); + std::map<int, int>::const_iterator iter = m_tableSizes.find(m_ps->m_tableStates.top().m_currentTableId); + if (iter != m_tableSizes.end()) + numColumns = iter->second; WPXPropertyListVector columns; - parseTableColumns(_findTableProperty("table-column-props"), columns); - if (!columns.count()) + for (unsigned j = 0; j < numColumns; ++j) { - std::map<int, int>::const_iterator iter = m_tableSizes.find(m_ps->m_tableStates.top().m_currentTableId); - if (iter != m_tableSizes.end()) - { - for (int j = 0; j < iter->second; ++j) - columns.append(WPXPropertyList()); - } + if (j < tmpColumns.count()) + columns.append(tmpColumns[j]); + else + columns.append(WPXPropertyList()); } ABWUnit unit(ABW_NONE); |