summaryrefslogtreecommitdiff
path: root/vcl/source/window/menu.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-10-14 12:00:03 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-14 17:30:32 +0200
commit19be86249dcc5b13b3c95f5469600fa2bc1b749b (patch)
treee1468590650eea60e3897a8cb8b7c36bb9ab996b /vcl/source/window/menu.cxx
parent7758115d15ded2afd81946df0865ecc831b179aa (diff)
Simplify containers iterations in vcl
Use range-based loop or replace with STL functions. Change-Id: Ide2f89194238ae6a1f21e8132e2297710d9e6dcd Reviewed-on: https://gerrit.libreoffice.org/61756 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/window/menu.cxx')
-rw-r--r--vcl/source/window/menu.cxx6
1 files changed, 1 insertions, 5 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index d1adaf25211c..30741a4ed620 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -400,14 +400,10 @@ void Menu::ImplCallEventListeners( VclEventId nEvent, sal_uInt16 nPos )
{
// Copy the list, because this can be destroyed when calling a Link...
std::list<Link<VclMenuEvent&,void>> aCopy( maEventListeners );
- std::list<Link<VclMenuEvent&,void>>::iterator aIter( aCopy.begin() );
- std::list<Link<VclMenuEvent&,void>>::const_iterator aEnd( aCopy.end() );
- while ( aIter != aEnd )
+ for ( const auto& rLink : aCopy )
{
- Link<VclMenuEvent&,void> &rLink = *aIter;
if( std::find(maEventListeners.begin(), maEventListeners.end(), rLink) != maEventListeners.end() )
rLink.Call( aEvent );
- ++aIter;
}
}
}