summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2011-08-15 23:42:03 +0200
committerJulien Nabet <serval2412@yahoo.fr>2011-08-15 23:42:03 +0200
commitfbba74ca98c1e4e2256a11139786f18c0543591e (patch)
treedc120a55453b7e97718f132a8d0d2e8c367d0c38 /sw
parent8e4adb6038f8675d87d6766e62721f8e23fc91de (diff)
Fix cppcheck division by 0 detected (thanks Noel and Norbert)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/vba/vbarows.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/source/ui/vba/vbarows.cxx b/sw/source/ui/vba/vbarows.cxx
index 7b1f93925106..01c8dfdd6f46 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