diff options
Diffstat (limited to 'sc/source/ui/view/gridwin.cxx')
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 650ab56cf520..9c49099f2c8d 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -671,7 +671,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) nSizeX = nSizeX / fZoomX; nSizeY = nSizeY / fZoomY; } - tools::Rectangle aCellRect(OutputToScreenPixel(aPos), Size(nSizeX, nSizeY)); + tools::Rectangle aCellRect(bLOKActive ? aPos : OutputToScreenPixel(aPos), Size(nSizeX, nSizeY)); ScDBData* pDBData = pDoc->GetDBAtCursor(nCol, nRow, nTab, ScDBDataPortion::AREA); if (!pDBData) @@ -924,7 +924,8 @@ void ScGridWindow::LaunchPageFieldMenu( SCCOL nCol, SCROW nRow ) Point aScrPos; Size aScrSize; getCellGeometry(aScrPos, aScrSize, pViewData, nCol, nRow, eWhich); - DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, ScAddress(nCol-1, nRow, nTab), pDPObj); + bool bLOK = comphelper::LibreOfficeKit::isActive(); + DPLaunchFieldPopupMenu(bLOK ? aScrPos : OutputToScreenPixel(aScrPos), aScrSize, ScAddress(nCol-1, nRow, nTab), pDPObj); } void ScGridWindow::LaunchDPFieldMenu( SCCOL nCol, SCROW nRow ) @@ -937,7 +938,8 @@ void ScGridWindow::LaunchDPFieldMenu( SCCOL nCol, SCROW nRow ) Point aScrPos; Size aScrSize; getCellGeometry(aScrPos, aScrSize, pViewData, nCol, nRow, eWhich); - DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, ScAddress(nCol, nRow, nTab), pDPObj); + bool bLOK = comphelper::LibreOfficeKit::isActive(); + DPLaunchFieldPopupMenu(bLOK ? aScrPos : OutputToScreenPixel(aScrPos), aScrSize, ScAddress(nCol, nRow, nTab), pDPObj); } void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange ) @@ -2612,8 +2614,14 @@ void ScGridWindow::MouseMove( const MouseEvent& rMEvt ) } } - if ( pViewData->GetView()->GetSelEngine()->SelMouseMove( rMEvt ) ) - return; + // In LOK case, avoid spurious "leavingwindow" mouse move events which has negative coordinates. + // Such events occur for some reason when a user is selecting a range, (even when not leaving the view area) + // with one or more other viewers in that sheet. + bool bSkipSelectionUpdate = comphelper::LibreOfficeKit::isActive() && + rMEvt.IsLeaveWindow() && (aCurMousePos.X() < 0 || aCurMousePos.Y() < 0); + + if (!bSkipSelectionUpdate) + pViewData->GetView()->GetSelEngine()->SelMouseMove( rMEvt ); } static void lcl_InitMouseEvent(css::awt::MouseEvent& rEvent, const MouseEvent& rEvt) |