diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-04-18 11:54:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-04-18 12:21:43 +0100 |
commit | 902cafe656a017b996e72313274e412bfa0ba838 (patch) | |
tree | f307189cabe4b28bcec5f047385e1457944a4b74 /svtools | |
parent | b061dbd76bc3a09edd42b5e580a80ae93d62eb1b (diff) |
coverity#1202783 Division or modulo by zero
Change-Id: I183416ad3db39108e52c1e69b60fb547448b21a8
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/valueset.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index dde15796c616..b64927892c77 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1736,8 +1736,8 @@ Rectangle ValueSet::ImplGetItemRect( size_t nPos ) const nPos -= nVisibleBegin; - const size_t row = nPos/mnCols; - const size_t col = nPos%mnCols; + const size_t row = mnCols ? nPos/mnCols : 0; + const size_t col = mnCols ? nPos%mnCols : 0; const long x = maItemListRect.Left()+col*(mnItemWidth+mnSpacing); const long y = maItemListRect.Top()+row*(mnItemHeight+mnSpacing); |