sw/source/core/doc/doctxm.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ba58fc11723b7c9d370d6407385ea0e8829db099
Author:     Andreas Heinisch <[email protected]>
AuthorDate: Thu Oct 13 22:11:35 2022 +0200
Commit:     Andreas Heinisch <[email protected]>
CommitDate: Tue Oct 18 08:15:48 2022 +0200

    tdf#151462 - Search for outline node containing the current node
    
    If the index lies within a special section, the position of the anchor of 
the corresponding section will used to search the node of the paragraph. This 
patch searches for the outline node of the found paragraph in order to find all 
the corresponding sub indexes.
    
    Change-Id: I9be4bdc0768d5d0d5987d47d37e41acc5009cca8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141344
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <[email protected]>

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 36c197732cd9..09c44f1ef489 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -733,6 +733,8 @@ static const SwTextNode* lcl_FindChapterNode( const SwNode& 
rNd,
             SwPosition aPos( *pNd );
             pNd = GetBodyTextNode( pNd->GetDoc(), aPos, *pFrame );
             OSL_ENSURE( pNd, "Where's the paragraph?" );
+            // tdf#151462 - search for outline node containing the current node
+            return pNd->FindOutlineNodeOfLevel(pNd->GetSectionLevel() - 1, 
pLayout);
         }
     }
     return pNd ? pNd->FindOutlineNodeOfLevel(nLvl, pLayout) : nullptr;

Reply via email to