[Libreoffice-commits] core.git: writerfilter/source

Luboš Luňák l.lunak at suse.cz
Mon Apr 22 09:08:03 PDT 2013


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

New commits:
commit c8da8f48415c058c70698a7b4a6716bd41cfeeb9
Author: Luboš Luňák <l.lunak at 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)
         {


More information about the Libreoffice-commits mailing list