diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-06 13:47:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-06 14:48:02 +0000 |
commit | 7ca34b04c0915cb00345afa1ba7cfc736f82f9a1 (patch) | |
tree | 20fe59ffd291fc432f1515987876d840d7315be2 | |
parent | 62eaee4858397f409da1474c71f1954b8d8e571e (diff) |
coverity#735645 Division or modulo by zero
Change-Id: I03b8404f90b6a05189591d8e3423f32810057a47
-rw-r--r-- | sw/source/filter/xml/xmltbli.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index fdc0bbc0c045..fb3ed88064a6 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/table/XCellRange.hpp> +#include <o3tl/numeric.hxx> #include <svl/itemset.hxx> #include <svl/zformat.hxx> #include <sax/tools/converter.hxx> @@ -2446,6 +2447,8 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox ) { if( !colIter->isRelative ) { + if (nMinAbsColWidth == 0) + throw o3tl::divide_by_zero(); sal_Int32 nRelCol = ( colIter->width * nMinRelColWidth) / nMinAbsColWidth; colIter->width = nRelCol; colIter->isRelative = true; |