sc/source/ui/view/select.cxx |   25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

New commits:
commit 7619390bd15fa26fc8f74d75f187cf8bf2fca58b
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Mar 15 16:54:44 2018 +0000

    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 <c...@libreoffice.org>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

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 );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to