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
This commit is contained in:
Luboš Luňák
2013-04-22 18:06:26 +02:00
parent b8dd396976
commit c8da8f4841

View File

@@ -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)
{