sw/source/core/docnode/ndsect.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
New commits: commit 88192717f9e311dc810e472aec5fcdd50c922c35 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Feb 16 12:41:19 2024 +0600 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Fri Feb 16 09:11:54 2024 +0100 Simplify a bit Change-Id: I31b31b112433ef7b5b75ff300d7ecf92f3fbcc03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163472 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 856447d4d8d2..bd58372d38ac 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -965,12 +965,9 @@ SwSectionNode* SwNodes::InsertTextSection(SwNode& rNd, SwSectionNode* SwNode::FindSectionNode() { - if( IsSectionNode() ) - return GetSectionNode(); - SwStartNode* pTmp = m_pStartOfSection; - while( !pTmp->IsSectionNode() && pTmp->GetIndex() ) - pTmp = pTmp->m_pStartOfSection; - return pTmp->GetSectionNode(); + for (SwNode* tmp = this;; tmp = tmp->StartOfSectionNode()) + if (SwSectionNode* sectNode = tmp->GetSectionNode(); sectNode || !tmp->GetIndex()) + return sectNode; } // SwSectionNode