summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-11-02 21:09:53 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-11-02 18:27:27 +0100
commitb800b10737b5df377d8e06e920f10f955b8ddcad (patch)
tree0ba654340b5dc4a9478e8a4a66cc4803352837dc /sw
parent4f1c88bb57ba0ceadb847e4ce6a00528ad9e7ada (diff)
Simplify a bit
Change-Id: Ia297a94b9fe06074e06ca573173a9e9c41834240 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175954 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/shells/textsh1.cxx17
1 files changed, 3 insertions, 14 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 78ae5f81ebcd..1cb57d0a59cf 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -523,21 +523,10 @@ void DeleteSections(SfxRequest& rReq, SwWrtShell& rWrtSh)
});
SwDoc* pDoc = rWrtSh.GetDoc();
- SwSectionFormats& rFormats = pDoc->GetSections();
std::vector<SwSectionFormat*> aRemovals;
- for (SwSectionFormat* pFormat : rFormats)
- {
-
- if (!aSectionNamePrefix.isEmpty())
- {
- if (!pFormat->GetName().startsWith(aSectionNamePrefix))
- {
- continue;
- }
- }
-
- aRemovals.push_back(pFormat);
- }
+ for (SwSectionFormat* pFormat : pDoc->GetSections())
+ if (aSectionNamePrefix.isEmpty() || pFormat->GetName().startsWith(aSectionNamePrefix))
+ aRemovals.push_back(pFormat);
for (const auto& pFormat : aRemovals)
{