sw/source/core/docnode/nodes.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 18ccdfc248fdc9d7f17f84c1067fee27a62b0772
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Sep 19 11:00:15 2023 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Sep 26 17:39:24 2023 +0200

    tdf#157131 sw: only check for table in same top-level section
    
    The problem is that SwNodes::FindPrvNxtFrameNode() is called with the
    first node in the body and moves backwards to a node that is in a table
    in a text frame.
    
    (regression from commit faf2d9e2cb13c3750ac359338f8f31fc1afce368)
    
    Change-Id: I9bd353f07ea6361b332134186a6a4462119b597c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157045
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 655874489a13af50b763b75c188b2a8db52c7fc0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157053
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 9f9c516e8f3b..c6ecb9ccf974 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -2250,7 +2250,7 @@ SwNode* SwNodes::FindPrvNxtFrameNode( const SwNode& 
rFrameNd,
         {
             pFrameNd = GoPrevSection( &aIdx, true, false );
             // did we move *into* a table?
-            if (pFrameNd)
+            if (pFrameNd && ::CheckNodesRange(aIdx.GetNode(), rFrameNd, true))
             {
                 for (SwTableNode * pTable = pFrameNd->FindTableNode();
                     pTable && pTable->EndOfSectionIndex() < 
rFrameNd.GetIndex();
@@ -2328,7 +2328,7 @@ SwNode* SwNodes::FindPrvNxtFrameNode( const SwNode& 
rFrameNd,
         {
             pFrameNd = GoNextSection( &aIdx, true, false );
             // did we move *into* a table?
-            if (pFrameNd)
+            if (pFrameNd && ::CheckNodesRange(aIdx.GetNode(), rFrameNd, true))
             {
                 for (SwTableNode * pTable = pFrameNd->FindTableNode();
                     pTable && pEnd->GetIndex() < pTable->GetIndex();

Reply via email to