[Libreoffice-commits] core.git: basctl/source
Norbert Thiebaud
nthiebaud at gmail.com
Mon Feb 18 07:18:06 PST 2013
basctl/source/basicide/linenumberwindow.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 6d76752bb1369b56978094f4e73c76a8a9a020c0
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Mon Feb 18 02:19:27 2013 -0600
coverity#735601 coverity#736164
Change-Id: I5805d749ba32bec778ae98e9b30ba68d74cc44c3
Reviewed-on: https://gerrit.libreoffice.org/2219
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/basctl/source/basicide/linenumberwindow.cxx b/basctl/source/basicide/linenumberwindow.cxx
index 79edc16..2bd4dbe 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));
}
More information about the Libreoffice-commits
mailing list