diff options
| author | Caolán McNamara <caolanm@redhat.com> | 2018-03-15 16:54:44 +0000 |
|---|---|---|
| committer | Eike Rathke <erack@redhat.com> | 2018-03-16 17:00:01 +0100 |
| commit | d47a28723ee5b8df2f9e34449b15fac7970a1c69 (patch) | |
| tree | 127097362ff7e381c2338e2cfa694d458fd627e1 | |
| parent | be83e928279bf3c6ae3fd316571d02dc452b45e8 (diff) | |
Resolves: tdf#115923 try a different approach to solving tdf#46637
Try scrolling to the cell the mouse is over if its not fully visible already
and this is not autofill selection. To avoid the mouse over the autofill handle
which overflows into neighbours scrolling the neighbour cell into view before
its truly desired to be selected when the mouse passes the center point
in other words, for autofill go back to how it always was
Change-Id: I6f67ad0f49c2d4087949f71f38322f06ced13c79
Reviewed-on: https://gerrit.libreoffice.org/51392
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
| -rw-r--r-- | sc/source/ui/view/select.cxx | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx index f06043c79276..fcfe6eddf1c5 100644 --- a/sc/source/ui/view/select.cxx +++ b/sc/source/ui/view/select.cxx @@ -321,13 +321,28 @@ bool ScViewFunctionSet::SetCursorAtPoint( const Point& rPointPixel, bool /* bDon pEngine->GetWindow(), nullptr, false); - bool bBottomScroll = ( aEditArea.Bottom() >= aWinSize.Height() ); - bool bRightScroll = ( aEditArea.Right() >= aWinSize.Width() ); + bool bFillingSelection = pViewData->IsFillMode() || pViewData->GetFillMode() == ScFillMode::MATRIX; + bool bBottomScroll; + bool bRightScroll; + // for Autofill don't yet assume we want to auto-scroll to the cell under the mouse + // because the autofill handle extends into a cells neighbours so initial click is usually + // above a neighbour cell + if (bFillingSelection) + { + bBottomScroll = aEffPos.X() >= aWinSize.Height(); + bRightScroll = aEffPos.Y() >= aWinSize.Width(); + } + else + { + //in the normal case make the full selected cell visible + bBottomScroll = aEditArea.Bottom() >= aWinSize.Height(); + bRightScroll = aEditArea.Right() >= aWinSize.Width(); + } + bool bScroll = bRightScroll || bBottomScroll || bLeftScroll || bTopScroll; - // for Autofill switch in the center of cell - // thereby don't prevent scrolling to bottom/right - if ( pViewData->IsFillMode() || pViewData->GetFillMode() == ScFillMode::MATRIX ) + // for Autofill switch in the center of cell thereby don't prevent scrolling to bottom/right + if (bFillingSelection) { bool bLeft, bTop; pViewData->GetMouseQuadrant( aEffPos, GetWhich(), nPosX, nPosY, bLeft, bTop ); |
