Kaydet (Commit) c8da8f48 authored tarafından Luboš Luňák's avatar Luboš Luňák

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
üst b8dd3969
...@@ -584,6 +584,10 @@ void DomainMapperTableManager::endOfRowAction() ...@@ -584,6 +584,10 @@ void DomainMapperTableManager::endOfRowAction()
text::TableColumnSeparator* pSeparators = aSeparators.getArray(); text::TableColumnSeparator* pSeparators = aSeparators.getArray();
sal_Int16 nSum = 0; sal_Int16 nSum = 0;
sal_uInt32 nPos = 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) for (sal_uInt32 i = 0; i < pCellWidths->size() - 1; ++i)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment