diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-04-22 18:06:26 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-08-07 14:47:39 +0200 |
commit | d4d1d426d5cfe755ed82d8b8b5d6061883890453 (patch) | |
tree | 7175ea3d0c25749652c7c3860566ee6867de97da | |
parent | b7d791f358332f0fe36d31b3842067e7de068dcf (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
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableManager.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 527793e0f421..59ce1eac2d84 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -622,6 +622,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) { |