diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-02-15 20:00:16 +0600 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-02-16 08:37:33 +0100 |
commit | 9bb7d239258133020dea5fb8cd8c3b18f706d4e2 (patch) | |
tree | 5ea1c219803bc20f80e29e56a41ea92fd5f4bfc0 /sw/source/uibase/utlui | |
parent | 63562694beb42b86d0f00dd3c18ac47bb094c9fe (diff) |
Deduplicate and unify SwNodes::Go(Next|Prev)(Section)
The "Next" methods are made static, just as "Prev" ones. Overloads
taking SwNodeIndex and SwPosition are implemented using a common
implementation function, to avoid code duplication.
Change-Id: I4035188b5c29d19824cd6d031e05d668d5cf1e86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163443
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/uibase/utlui')
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index b058cf46c464..fa1c7e10d447 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -203,7 +203,7 @@ namespace SwNodeIndex aIdx(*rTextFootnote.GetStartNode(), 1); SwContentNode* pCNd = aIdx.GetNode().GetTextNode(); if(!pCNd) - pCNd = aIdx.GetNodes().GoNext(&aIdx); + pCNd = SwNodes::GoNext(&aIdx); return pCNd->IsTextNode() ? static_cast<SwTextNode*>(pCNd)->GetText() : OUString(); } @@ -1488,7 +1488,7 @@ static void lcl_SetOutlineContentEntriesSensitivities(SwContentTree* pThis, cons // selected SwNodeIndex aIdx(*pSttNd); - if (rNodes.GoNext(&aIdx) != pEndNd) + if (SwNodes::GoNext(&aIdx) != pEndNd) bHasContent = true; // descendants @@ -1504,7 +1504,7 @@ static void lcl_SetOutlineContentEntriesSensitivities(SwContentTree* pThis, cons // test for content in outline node aIdx.Assign(*pSttNd); - if (rNodes.GoNext(&aIdx) != pEndNd) + if (SwNodes::GoNext(&aIdx) != pEndNd) { bHasContent = true; break; @@ -1530,7 +1530,7 @@ static void lcl_SetOutlineContentEntriesSensitivities(SwContentTree* pThis, cons pEndNd = rOutlineNodes[nPos + 1]; SwNodeIndex aIdx(*pSttNd); - if (rNodes.GoNext(&aIdx) != pEndNd) + if (SwNodes::GoNext(&aIdx) != pEndNd) break; nPos++; } @@ -1548,7 +1548,7 @@ static void lcl_SetOutlineContentEntriesSensitivities(SwContentTree* pThis, cons pEndNd = rOutlineNodes[nPos + 1]; SwNodeIndex aIdx(*pSttNd); - if (rNodes.GoNext(&aIdx) == pEndNd) + if (SwNodes::GoNext(&aIdx) == pEndNd) continue; // skip if no content if (!pThis->GetWrtShell()->IsOutlineContentVisible(nPos)) |