From 587ef41f75b8ea0bcd03366178d42a324dcf481c Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Sun, 18 Nov 2018 13:43:28 +0300 Subject: Simplify containers iterations in svx/source/[s-u]* Use range-based loop or replace with STL functions Change-Id: I2ec3e58cc46c9286ef863c732912ca7a729bab62 Reviewed-on: https://gerrit.libreoffice.org/63522 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svx/source/unodraw/unoprov.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'svx/source/unodraw/unoprov.cxx') diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index 64e2649d7d7c..2d4def595acb 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -833,11 +833,10 @@ OUString UHashMap::getNameFromId(sal_uInt32 nId) { const UHashMapImpl &rMap = GetUHashImpl(); - for (UHashMapImpl::const_iterator it = rMap.begin(); it != rMap.end(); ++it) - { - if (it->second == nId) - return it->first; - } + auto it = std::find_if(rMap.begin(), rMap.end(), + [nId](const UHashMapImpl::value_type& rEntry) { return rEntry.second == nId; }); + if (it != rMap.end()) + return it->first; OSL_FAIL("[CL] unknown SdrObject identifier"); return OUString(); } -- cgit