[Libreoffice-commits] .: sw/source

Julien Nabet serval2412 at kemper.freedesktop.org
Mon Aug 15 14:42:34 PDT 2011


 sw/source/ui/vba/vbarows.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit fbba74ca98c1e4e2256a11139786f18c0543591e
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Aug 15 23:42:03 2011 +0200

    Fix cppcheck division by 0 detected (thanks Noel and Norbert)

diff --git a/sw/source/ui/vba/vbarows.cxx b/sw/source/ui/vba/vbarows.cxx
index 7b1f939..01c8dfd 100644
--- a/sw/source/ui/vba/vbarows.cxx
+++ b/sw/source/ui/vba/vbarows.cxx
@@ -263,6 +263,10 @@ void SwVbaRows::setIndentWithAdjustNone( sal_Int32 indent ) throw (uno::RuntimeE
     sal_Int32 nWidth = 0;
     xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ) ) >>= nWidth;
     sal_Int32 nNewWidth = nWidth - indent;
+    if ((nNewWidth <= 0) || (nWidth <= 0))
+    {
+        throw new RuntimeException("Pb with width, in SwVbaRows::setIndentWithAdjustProportional (nNewWidth <= 0) || (nWidth <= 0)");
+    }
     double propFactor = (double)nNewWidth/(double)nWidth;
 
     // get all columns, calculate and set the new width of the columns


More information about the Libreoffice-commits mailing list