summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-08-28 15:27:07 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-08-28 16:15:12 +0200
commit76d1ca523ddcf89cc269fe51c70e66066943ef5a (patch)
tree51154f20fc49e8e7f71b16354aa48a2a39a2ccb1 /writerfilter
parentb70d4ad13b909265c54a9ff55f07224a14e9feb2 (diff)
bnc#816593 DOCX import: fix auto table width wrt nested tables
The bugdoc has a table with a single cell, and also a nested table in that cell. Both tables have auto width. The problem was that the width of the outer table was too large. There is a trick in DomainMapperTableManager::startLevel() to get the cell widths at the correct level: do the same in DomainMapperTableManager::endLevel(), and that'll fix the table width problem. (Because with that, the outer table will correctly have access to its cell width.) Change-Id: Ib750f0475364fd7e47c445cb54f2df34f3af085d
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 80ffb4873c29..ac75e073fc85 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -483,7 +483,16 @@ void DomainMapperTableManager::endLevel( )
{
m_aTableGrid.pop_back( );
m_aGridSpans.pop_back( );
+
+ // Do the same trick as in startLevel(): pop the value that was pushed too early.
+ boost::optional<sal_Int32> oCurrentWidth;
+ if (m_bPushCurrentWidth && !m_aCellWidths.empty() && !m_aCellWidths.back()->empty())
+ oCurrentWidth.reset(m_aCellWidths.back()->back());
m_aCellWidths.pop_back( );
+ // And push it back to the right level.
+ if (oCurrentWidth)
+ m_aCellWidths.back()->push_back(*oCurrentWidth);
+
m_nCell.pop_back( );
m_nTableWidth = 0;
m_nLayoutType = 0;