[Libreoffice-commits] core.git: sc/source

tagezi lera.goncharuk at gmail.com
Tue Jan 30 22:12:27 UTC 2018


 sc/source/ui/view/tabview3.cxx |   31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)

New commits:
commit b0a391d62c1df7525069a02913a52af940d92ecc
Author: tagezi <lera.goncharuk at gmail.com>
Date:   Fri Jan 26 16:26:53 2018 +0300

    Circular movement of cursor in a table with  hidden columns/rows, tdf#68290 related
    
    If there is a table with range on the edges of the hidden columns/rows,
    it allows you to quickly jump to the beginning/end of a neighboring
    column using Enter/Shift+Enter
    
    Change-Id: I5b18789b70089a6987ec7718998f5861261b22f8
    Reviewed-on: https://gerrit.libreoffice.org/48691
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 13e2ac264bea..f8a5a7b4da53 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1369,21 +1369,21 @@ void ScTabView::MoveCursorEnter( bool bShift )          // bShift -> up/down
             break;
     }
 
+    SCCOL nCurX;
+    SCROW nCurY;
+    aViewData.GetMoveCursor( nCurX,nCurY );
+    SCCOL nNewX = nCurX;
+    SCROW nNewY = nCurY;
+    SCTAB nTab  = aViewData.GetTabNo();
+
     ScMarkData& rMark = aViewData.GetMarkData();
+    ScDocument* pDoc  = aViewData.GetDocument();
+
     if (rMark.IsMarked() || rMark.IsMultiMarked())
     {
-        SCCOL nCurX;
-        SCROW nCurY;
-        aViewData.GetMoveCursor( nCurX,nCurY );
-        SCCOL nNewX = nCurX;
-        SCROW nNewY = nCurY;
-        SCTAB nTab = aViewData.GetTabNo();
+        pDoc->GetNextPos( nNewX, nNewY, nTab, nMoveX, nMoveY, true, false, rMark );
 
-        ScDocument* pDoc = aViewData.GetDocument();
-        pDoc->GetNextPos( nNewX,nNewY, nTab, nMoveX,nMoveY, true, false, rMark );
-
-        MoveCursorRel( nNewX-nCurX, nNewY-nCurY,
-                            SC_FOLLOW_LINE, false, true );
+        MoveCursorRel( nNewX - nCurX, nNewY - nCurY, SC_FOLLOW_LINE, false, true );
 
         //  update input line even if cursor was not moved
         if ( nNewX == nCurX && nNewY == nCurY )
@@ -1393,18 +1393,17 @@ void ScTabView::MoveCursorEnter( bool bShift )          // bShift -> up/down
     {
         if ( nMoveY != 0 && !nMoveX )
         {
+            pDoc->GetNextPos( nNewX, nNewY, nTab, nMoveX, nMoveY, true, false, rMark );
+
             // after Tab and Enter back to the starting column again
             SCCOL nTabCol = aViewData.GetTabStartCol();
             if (nTabCol != SC_TABSTART_NONE)
             {
-                SCCOL nCurX;
-                SCROW nCurY;
-                aViewData.GetMoveCursor( nCurX,nCurY );
-                nMoveX = nTabCol-nCurX;
+                nNewX = nTabCol;
             }
         }
 
-        MoveCursorRel( nMoveX,nMoveY, SC_FOLLOW_LINE, false );
+        MoveCursorRel( nNewX - nCurX, nNewY - nCurY, SC_FOLLOW_LINE, false, true );
     }
 }
 


More information about the Libreoffice-commits mailing list