From b65a0b7fb7edbb15b2c1a534cc753afe4362c143 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 11 Aug 2019 12:44:11 +0100 Subject: cid#1448422 Division or modulo by zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id4bd62b13ed5c797274915f5b1fa44fa3bc46c1c Reviewed-on: https://gerrit.libreoffice.org/77267 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- accessibility/inc/extended/accessibletablistboxtable.hxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'accessibility') 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; -- cgit