tdf#158783 sw: SwCursorShell::GotoTOXMark() must actually move cursor
The problem was that the buttons in SwIndexMarkPane got the
next/previous mark, but SwCursorShell::GotoTOXMark() may return the
next/previous mark without actually moving the cursor.
It happens that the current mark is outside a table and the next mark is
inside a table, then UpdateCursor() doesn't accept the invalid cursor
range and resets the point to its previous position.
Change-Id: I5c0fb4a9bbcbdd479581172834b6eda76a5abbc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161970
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 00c1c2e..e934cd1 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -602,6 +602,7 @@ const SwTOXMark& SwCursorShell::GotoTOXMark( const SwTOXMark& rStart,
SwPosition& rPos = *GetCursor()->GetPoint();
rPos.Assign(rNewMark.GetTextTOXMark()->GetTextNode(),
rNewMark.GetTextTOXMark()->GetStart() );
GetCursor()->DeleteMark(); // tdf#158783 prevent UpdateCursor resetting point
if( !m_pCurrentCursor->IsSelOvr() )
UpdateCursor( SwCursorShell::SCROLLWIN | SwCursorShell::CHKRANGE |