diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-02-18 02:19:27 -0600 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-02-18 15:17:47 +0000 |
commit | 6d76752bb1369b56978094f4e73c76a8a9a020c0 (patch) | |
tree | 09ca197449b695e23447c68a3e844f3c04133f30 /basctl | |
parent | 8e26d08009eae63d731ceb6cf848530886cb7bd3 (diff) |
coverity#735601 coverity#736164
Change-Id: I5805d749ba32bec778ae98e9b30ba68d74cc44c3
Reviewed-on: https://gerrit.libreoffice.org/2219
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/linenumberwindow.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/basctl/source/basicide/linenumberwindow.cxx b/basctl/source/basicide/linenumberwindow.cxx index 79edc16221eb..2bd4dbef1351 100644 --- a/basctl/source/basicide/linenumberwindow.cxx +++ b/basctl/source/basicide/linenumberwindow.cxx @@ -65,6 +65,10 @@ void LineNumberWindow::Paint( const Rectangle& ) int windowHeight = GetOutputSize().Height(); int nLineHeight = GetTextHeight(); + if(!nLineHeight) + { + return; + } int startY = txtView->GetStartDocPos().Y(); int nStartLine = startY / nLineHeight + 1; @@ -86,7 +90,7 @@ void LineNumberWindow::Paint( const Rectangle& ) m_nWidth += m_nBaseWidth; } - sal_Int64 y = (nStartLine - 1) * nLineHeight; + sal_Int64 y = (nStartLine - 1) * (sal_Int64)nLineHeight; for(sal_Int32 n = nStartLine; n <= nEndLine; ++n, y += nLineHeight) DrawText(Point(0, y - m_nCurYOffset), OUString::valueOf(n)); } |