summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-09-08 09:28:00 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-09-12 01:45:28 +0200
commitec1de2a4ff284f9f1d2e8147af91a8a1588652a1 (patch)
treeb5f6d4eaf471048725ab0a134b12a971f5f84a64 /basctl
parent1b42acdaeae134f94580d6e1eba89da16741d596 (diff)
coverity#735600 Division by zero
Change-Id: Ia936814ae37ae802fab36f7bde56de09338eb617
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside2b.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 2fadb712aa84..71189892deff 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1474,10 +1474,13 @@ void BreakPointWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
Point aMousePos( PixelToLogic( rMEvt.GetPosPixel() ) );
long nLineHeight = GetTextHeight();
- long nYPos = aMousePos.Y() + nCurYOffset;
- long nLine = nYPos / nLineHeight + 1;
- rModulWindow.ToggleBreakPoint( (sal_uLong)nLine );
- Invalidate();
+ if(nLineHeight)
+ {
+ long nYPos = aMousePos.Y() + nCurYOffset;
+ long nLine = nYPos / nLineHeight + 1;
+ rModulWindow.ToggleBreakPoint( (sal_uLong)nLine );
+ Invalidate();
+ }
}
}