From 31795be8ee5bcc113f2d18d315f842a89e95b316 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 19 Nov 2023 20:52:41 +0100 Subject: c++20: use std::erase(_if) instead of std::remove(_if)+erase (svtools) Change-Id: I53a244ac751dbe9d40e8f541fcb6d7ff89ff83f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159701 Tested-by: Jenkins Reviewed-by: Julien Nabet --- svtools/source/config/miscopt.cxx | 2 +- svtools/source/dialogs/insdlg.cxx | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx index 625086eee24c..ca8537b1c38c 100644 --- a/svtools/source/config/miscopt.cxx +++ b/svtools/source/config/miscopt.cxx @@ -228,7 +228,7 @@ void SvtMiscOptions_Impl::AddListenerLink( const Link& rLin void SvtMiscOptions_Impl::RemoveListenerLink( const Link& rLink ) { - aList.erase(std::remove(aList.begin(), aList.end(), rLink), aList.end()); + std::erase(aList, rLink); } void SvtMiscOptions_Impl::CallListeners() diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx index 7fe1728f4194..50fad4a75dcd 100644 --- a/svtools/source/dialogs/insdlg.cxx +++ b/svtools/source/dialogs/insdlg.cxx @@ -97,9 +97,7 @@ const SvObjectServer * SvObjectServerList::Get( const SvGlobalName & rName ) con void SvObjectServerList::Remove( const SvGlobalName & rName ) { - aObjectServerList.erase(std::remove_if(aObjectServerList.begin(), aObjectServerList.end(), - [rName](const SvObjectServer& rServer) { return rServer.GetClassName() == rName; }), - aObjectServerList.end()); + std::erase_if(aObjectServerList, [rName](const SvObjectServer& rServer) { return rServer.GetClassName() == rName; }); } -- cgit