From 8f3ca2e63b8145b504f764a17ab61d8a93f15a60 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 26 Oct 2017 16:29:03 +0200 Subject: tdf#113422 Crash in: ScPreview::MouseMove(MouseEvent const &) regression from commit 0ad8447d3199e1c1d1f7d6ddabc9b4cded99c2d6 dyncolcontainer: convert nRight to std::vector Change-Id: I9cdf80115a2be73ec2b30fd875a904de3333fddf Reviewed-on: https://gerrit.libreoffice.org/43905 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/ui/view/preview.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sc') diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 1ebead6706b7..ccd0c5cfa4c5 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -1358,7 +1358,8 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt ) { Point aColumnTop = LogicToPixel( Point( 0, -aOffset.Y() ) ,aMMMode ); Point aColumnBottom = LogicToPixel( Point( 0, (long)( nHeight * HMM_PER_TWIPS - aOffset.Y()) ), aMMMode ); - if( aPixPt.X() < ( mvRight[i] + 2 ) && ( aPixPt.X() > ( mvRight[i] - 2 ) ) && ( aPixPt.X() < aRightTop.X() ) && ( aPixPt.X() > aLeftTop.X() ) + long nRight = i < static_cast(mvRight.size()) ? mvRight[i] : 0; + if( aPixPt.X() < ( nRight + 2 ) && ( aPixPt.X() > ( nRight - 2 ) ) && ( aPixPt.X() < aRightTop.X() ) && ( aPixPt.X() > aLeftTop.X() ) && ( aPixPt.Y() > aColumnTop.Y() ) && ( aPixPt.Y() < aColumnBottom.Y() ) && !bLeftRulerMove && !bRightRulerMove && !bTopRulerMove && !bBottomRulerMove && !bHeaderRulerMove && !bFooterRulerMove ) { -- cgit