summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2013-04-22 18:06:26 +0200
committerLuboš Luňák <l.lunak@suse.cz>2013-04-22 18:07:41 +0200
commitc8da8f48415c058c70698a7b4a6716bd41cfeeb9 (patch)
treea56999e6b37f28c8ed14a9d63fd3330e3a54446b /writerfilter
parentb8dd39697607148fc9180ee8396f0251b467e956 (diff)
avoid crash when no table grid is given
The document may contain just <w:tblGrid/> and <w:tblW w:w="0" w:type="auto"/> . It appears we do not handle the auto width properly at all, but at least don't crash. Change-Id: Ibdc9d1ad69c13456acd347a151ec8739bcb98855
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index e10a3b6cc858..f0761b5ae1d1 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -584,6 +584,10 @@ void DomainMapperTableManager::endOfRowAction()
text::TableColumnSeparator* pSeparators = aSeparators.getArray();
sal_Int16 nSum = 0;
sal_uInt32 nPos = 0;
+ // Avoid divide by zero (if there's no grid, position using cell widths).
+ if( nFullWidthRelative == 0 )
+ for (sal_uInt32 i = 0; i < pCellWidths->size(); ++i)
+ nFullWidthRelative += (*pCellWidths.get())[i];
for (sal_uInt32 i = 0; i < pCellWidths->size() - 1; ++i)
{