From 9c0049cfae49c8e4ddef9125a69db2ad134c10c6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 7 Jun 2024 13:48:25 +0200 Subject: Merging upstream version 4:24.2.4. Signed-off-by: Daniel Baumann --- sw/source/core/crsr/crsrsh.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sw/source/core/crsr/crsrsh.cxx') diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index b7f6962982..33f11e9a28 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -738,9 +738,15 @@ bool SwCursorShell::MoveStartText() SwTableNode const*const pTable(pStartNode->FindTableNode()); m_pCurrentCursor->GetPoint()->Assign(*pStartNode); GetDoc()->GetNodes().GoNext(m_pCurrentCursor->GetPoint()); - while (m_pCurrentCursor->GetPoint()->GetNode().FindTableNode() != pTable - && (!pTable || pTable->GetIndex() < m_pCurrentCursor->GetPoint()->GetNode().FindTableNode()->GetIndex()) - && MoveOutOfTable()); + while (auto* pFoundTable = m_pCurrentCursor->GetPoint()->GetNode().FindTableNode()) + { + if (pFoundTable == pTable) + break; + if (pTable && pTable->GetIndex() >= pFoundTable->GetIndex()) + break; + if (!MoveOutOfTable()) + break; + } UpdateCursor(SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE|SwCursorShell::READONLY); return old != *m_pCurrentCursor->GetPoint(); } -- cgit v1.2.3