From 87712debecfd6852b41631c808f22c3ad2f69ee1 Mon Sep 17 00:00:00 2001 From: Marco Cecchetti Date: Mon, 9 Dec 2019 10:48:15 +0100 Subject: lok: calc: zoom: object selection - is unreliable Change-Id: Ic8e61c56bdf38bbb74f179fa36075bdd3a601249 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90068 Tested-by: Jenkins Reviewed-by: Marco Cecchetti --- sc/source/ui/view/gridwin3.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'sc') diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx index 1fbc48e0ae6f..7c6c6ad9a55e 100644 --- a/sc/source/ui/view/gridwin3.cxx +++ b/sc/source/ui/view/gridwin3.cxx @@ -41,6 +41,11 @@ bool ScGridWindow::DrawMouseButtonDown(const MouseEvent& rMEvt) FuPoor* pDraw = pViewData->GetView()->GetDrawFuncPtr(); if (pDraw && !pViewData->IsRefMode()) { + MapMode aDrawMode = GetDrawMapMode(); + MapMode aOldMode = GetMapMode(); + if ( comphelper::LibreOfficeKit::isActive() && aOldMode != aDrawMode ) + SetMapMode( aDrawMode ); + pDraw->SetWindow( this ); Point aLogicPos = PixelToLogic(rMEvt.GetPosPixel()); if ( pDraw->IsDetectiveHit( aLogicPos ) ) @@ -54,6 +59,9 @@ bool ScGridWindow::DrawMouseButtonDown(const MouseEvent& rMEvt) if ( bRet ) UpdateStatusPosSize(); } + + if ( comphelper::LibreOfficeKit::isActive() && aOldMode != aDrawMode ) + SetMapMode( aOldMode ); } // cancel draw with right key @@ -73,6 +81,11 @@ bool ScGridWindow::DrawMouseButtonUp(const MouseEvent& rMEvt) FuPoor* pDraw = pView->GetDrawFuncPtr(); if (pDraw && !pViewData->IsRefMode()) { + MapMode aDrawMode = GetDrawMapMode(); + MapMode aOldMode = GetMapMode(); + if ( comphelper::LibreOfficeKit::isActive() && aOldMode != aDrawMode ) + SetMapMode( aDrawMode ); + pDraw->SetWindow( this ); bRet = pDraw->MouseButtonUp( rMEvt ); @@ -89,6 +102,9 @@ bool ScGridWindow::DrawMouseButtonUp(const MouseEvent& rMEvt) if ( !pView->IsPaintBrushLocked() ) pView->ResetBrushDocument(); // end paint brush mode if not locked } + + if ( comphelper::LibreOfficeKit::isActive() && aOldMode != aDrawMode ) + SetMapMode( aOldMode ); } return bRet; @@ -99,10 +115,19 @@ bool ScGridWindow::DrawMouseMove(const MouseEvent& rMEvt) FuPoor* pDraw = pViewData->GetView()->GetDrawFuncPtr(); if (pDraw && !pViewData->IsRefMode()) { + MapMode aDrawMode = GetDrawMapMode(); + MapMode aOldMode = GetMapMode(); + if ( comphelper::LibreOfficeKit::isActive() && aOldMode != aDrawMode ) + SetMapMode( aDrawMode ); + pDraw->SetWindow( this ); bool bRet = pDraw->MouseMove( rMEvt ); if ( bRet ) UpdateStatusPosSize(); + + if ( comphelper::LibreOfficeKit::isActive() && aOldMode != aDrawMode ) + SetMapMode( aOldMode ); + return bRet; } else -- cgit