summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorSimon Chenery <simon_chenery@yahoo.com>2024-12-08 10:53:48 +0100
committerIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2024-12-28 15:44:06 +0100
commitba26de65b4f131ca3c76941dbb73dd9d3afde0d1 (patch)
treec745aed7756c6273a92c25f1bd5f46418fd3c692 /svtools
parentdf9f56259c52b21340a1429fa796e0aff1917a6d (diff)
tdf#153109 Use any_of instead of loop to check for match
Change-Id: I1ff9ff36520391bced7229eede86335d0a2b411f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178073 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/config/colorcfg.cxx11
1 files changed, 2 insertions, 9 deletions
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx
index 6787c43b8fa8..544e544cf398 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -174,15 +174,8 @@ void ColorConfig_Impl::Load(const OUString& rScheme)
if (!ThemeColors::IsAutomaticTheme(sScheme))
{
uno::Sequence<OUString> aSchemes = GetSchemeNames();
- bool bFound = false;
- for (const OUString& rSchemeName : aSchemes)
- {
- if (sScheme == rSchemeName)
- {
- bFound = true;
- break;
- }
- }
+ bool bFound = std::any_of(aSchemes.begin(), aSchemes.end(),
+ [&sScheme](const OUString& rSchemeName) { return sScheme == rSchemeName; });
if (!bFound)
sScheme = AUTOMATIC_COLOR_SCHEME;