diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-15 16:54:44 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-16 10:31:15 +0100 |
commit | 7619390bd15fa26fc8f74d75f187cf8bf2fca58b (patch) | |
tree | efd3e88735e24c5720d121dbef9163e8a4d3ba3f | |
parent | 24546ac5ea1d58d7cbd07d093b99c9ab07406b00 (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/51361
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@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 3783027f4052..781843bffeae 100644 --- a/sc/source/ui/view/select.cxx +++ b/sc/source/ui/view/select.cxx @@ -321,13 +321,28 @@ void 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 ); |