summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-08-11 12:44:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-08-11 16:00:59 +0200
commitb65a0b7fb7edbb15b2c1a534cc753afe4362c143 (patch)
treecbf1777ad3433edd9e100d8060392695451facc0 /accessibility
parent5a3e1685f741e597666ad2767d0749c01e041740 (diff)
cid#1448422 Division or modulo by zero
Change-Id: Id4bd62b13ed5c797274915f5b1fa44fa3bc46c1c Reviewed-on: https://gerrit.libreoffice.org/77267 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/inc/extended/accessibletablistboxtable.hxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/accessibility/inc/extended/accessibletablistboxtable.hxx b/accessibility/inc/extended/accessibletablistboxtable.hxx
index 68e71f0e83d1..78a679f45393 100644
--- a/accessibility/inc/extended/accessibletablistboxtable.hxx
+++ b/accessibility/inc/extended/accessibletablistboxtable.hxx
@@ -59,7 +59,13 @@ private:
sal_Int32 implGetSelRowCount() const;
/** Returns the row index from cell index. */
- sal_Int32 implGetRow( sal_Int32 _nIndex ) const { return _nIndex / implGetColumnCount(); }
+ sal_Int32 implGetRow( sal_Int32 _nIndex ) const
+ {
+ auto nColCount = implGetColumnCount();
+ assert(nColCount != 0);
+ return _nIndex / nColCount;
+ }
+
/** Returns the absolute row index of the nSelRow-th selected row. */
sal_Int32 implGetSelRow( sal_Int32 _nSelRow ) const;