summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-08-13 19:21:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-08-14 09:03:35 +0200
commit8bd23aaffd882e9fcc658263f083e645e9f91da0 (patch)
tree079b93aef9572d29fc19f7b4f6b00518b90f3060
parenttdf#77964 doc import: 0x1 placeholder is for AS_CHAR (diff)
downloadcore-8bd23aaffd882e9fcc658263f083e645e9f91da0.tar.gz
core-8bd23aaffd882e9fcc658263f083e645e9f91da0.zip
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.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/docnode/nodes.cxx6
1 files changed, 4 insertions, 2 deletions
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;
}