diff options
author | tagezi <lera.goncharuk@gmail.com> | 2018-01-26 16:26:53 +0300 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-01-30 23:12:04 +0100 |
commit | b0a391d62c1df7525069a02913a52af940d92ecc (patch) | |
tree | bee67e6d891cb3881817e23c0b757119e29a0312 | |
parent | b7896ade3e54c6809f588c3f2deab02b3d803a26 (diff) |
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@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 31 |
1 files changed, 15 insertions, 16 deletions
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 ); } } |