diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-09-08 09:28:00 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-09-12 01:45:28 +0200 |
commit | ec1de2a4ff284f9f1d2e8147af91a8a1588652a1 (patch) | |
tree | b5f6d4eaf471048725ab0a134b12a971f5f84a64 | |
parent | vcl: use DeviceCoordinate for GetCaretPositions in sallayout (diff) | |
download | core-ec1de2a4ff284f9f1d2e8147af91a8a1588652a1.tar.gz core-ec1de2a4ff284f9f1d2e8147af91a8a1588652a1.zip |
coverity#735600 Division by zero
Change-Id: Ia936814ae37ae802fab36f7bde56de09338eb617
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 11 |
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(); + } } } |