writerfilter/source/dmapper/DomainMapperTableManager.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit c8da8f48415c058c70698a7b4a6716bd41cfeeb9
Author: Luboš Luňák <l.lu...@suse.cz>
Date:   Mon Apr 22 18:06:26 2013 +0200

    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

diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx 
b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index e10a3b6..f0761b5 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)
         {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to