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

New commits:
commit 8bd23aaffd882e9fcc658263f083e645e9f91da0
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Aug 13 19:21:21 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Aug 14 09:03:35 2022 +0200

    improve lcl_HighestLevel
    
    only need to check for max when we are incrementing the level
    
    Change-Id: Ic8ae07783b6085c7566239d949cf351a11d0875f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138236
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 4cda9d0a6a8e..e5364783b848 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1437,11 +1437,13 @@ static bool lcl_HighestLevel( SwNode* pNode, void * 
pPara )
 {
     HighLevel * pHL = static_cast<HighLevel*>(pPara);
     if( pNode->GetStartNode() )
+    {
         pHL->nLevel++;
+        if( pHL->nTop > pHL->nLevel )
+            pHL->nTop = pHL->nLevel;
+    }
     else if( pNode->GetEndNode() )
         pHL->nLevel--;
-    if( pHL->nTop > pHL->nLevel )
-        pHL->nTop = pHL->nLevel;
     return true;
 
 }

Reply via email to