sw/source/core/crsr/crstrvl.cxx |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit 908abf0b0e36fd1c6e8d3df48e9c35ce911c9bda
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Fri Jan 12 12:52:51 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sat Jan 20 17:39:02 2024 +0100

    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.st...@allotropia.de>
    (cherry picked from commit 3fefff7ce29a234694343105c50c7bc3259a9cb8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161949
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index db11d4ea334a..81323787d7cc 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -600,6 +600,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 |

Reply via email to