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

New commits:
commit fdd44d9e7c6066aac8572d6d78dedef339b6058e
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Fri May 3 17:33:56 2024 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Tue May 7 10:43:06 2024 +0200

    tdf#40142 sw: only check level for table of contents
    
    Only Table of Contents has level settings, the level is always 0 for the
    other ToX types, which erroneously excludes nodes (as can be seen with
    testFDO77715 failing with upcoming tdf#160402 bugfix).
    
    (regression from commit 5c04c4474236cc50009aea6d89f7c443c861af19)
    
    Change-Id: Iec1c2b8eaba0ad20b2ad7d8c6b20603315a7a83d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167096
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 7178d6197b892e456a8db8a3d085a24bfd52cf32)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167212
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index d29223050b6a..f9533b37f647 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1375,7 +1375,8 @@ void SwTOXBaseSection::UpdateTemplate(const SwTextNode* 
pOwnChapterNode,
                     pTextNd->getLayoutFrame(pLayout) &&
                     pTextNd->GetNodes().IsDocNodes() &&
                     // tdf#40142 - consider level settings of the various text 
nodes
-                    o3tl::make_unsigned(pTextNd->GetAttrOutlineLevel()) <= 
GetLevel() &&
+                    (TOX_CONTENT != SwTOXBase::GetType() ||
+                     o3tl::make_unsigned(pTextNd->GetAttrOutlineLevel()) <= 
GetLevel()) &&
                     (!pLayout || !pLayout->HasMergedParas()
                         || 
static_cast<SwTextFrame*>(pTextNd->getLayoutFrame(pLayout))->GetTextNodeForParaProps()
 == pTextNd) &&
                     (!IsFromChapter() || IsHeadingContained(pOwnChapterNode, 
*pTextNd)))

Reply via email to