summaryrefslogtreecommitdiff
path: root/sw/source/uibase/shells/textsh1.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/shells/textsh1.cxx')
-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)
{