summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-19 15:07:09 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-03-19 21:19:21 +0100
commitcce17de6e7736341056604fc391c78295b097a7d (patch)
treea8f52d5262cc191b615949a43a691ee0b89a4894 /accessibility
parent864c129a7714085d371c2b127cbc8e5c862347e6 (diff)
coverity#1430077 add assert for 'Division or modulo by zero'
and coverity#1430076 Division or modulo by zero coverity#1430078 Division or modulo by float zero coverity#1430082 Division or modulo by float zero coverity#1430083 Division or modulo by zero coverity#1430085 Division or modulo by zero coverity#1430102 Division or modulo by zero coverity#1430103 Division or modulo by zero Change-Id: I9d7190f95d19a755c681f1f897a8921105ef7c46 Reviewed-on: https://gerrit.libreoffice.org/51568 Tested-by: Jenkins <ci@libreoffice.org> 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/helper/listboxhelper.hxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/accessibility/inc/helper/listboxhelper.hxx b/accessibility/inc/helper/listboxhelper.hxx
index 346fdf6a9ecb..0aa01abb21e5 100644
--- a/accessibility/inc/helper/listboxhelper.hxx
+++ b/accessibility/inc/helper/listboxhelper.hxx
@@ -65,7 +65,9 @@ public:
{
tools::Rectangle aTemp = m_aComboListBox.GetDropDownPosSizePixel();
Size aSize = aTemp.GetSize();
- aSize.setHeight( aSize.Height() / m_aComboListBox.GetDisplayLineCount() );
+ sal_uInt16 nLineCount = m_aComboListBox.GetDisplayLineCount();
+ assert(nLineCount && "div-by-zero");
+ aSize.setHeight( aSize.Height() / nLineCount );
Point aTopLeft = aTemp.TopLeft();
aTopLeft.AdjustY( aSize.Height() * ( nItem - m_aComboListBox.GetTopEntry() ) );
aRect = tools::Rectangle( aTopLeft, aSize );