From 169dff19d4da8d76e69b8e896aa25b0013639c03 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Wed, 2 Jan 2019 10:41:30 +0100 Subject: modernize loops --- src/ui/dialog/objects.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'src/ui/dialog/objects.cpp') diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp index 2954ea418..9e115a2d6 100644 --- a/src/ui/dialog/objects.cpp +++ b/src/ui/dialog/objects.cpp @@ -661,14 +661,14 @@ void ObjectsPanel::_checkTreeSelection() bool sensitiveNonTop = true; bool sensitiveNonBottom = true; - for ( std::vector::iterator it = _watching.begin(); it != _watching.end(); ++it ) { - (*it)->set_sensitive( sensitive ); + for (auto & it : _watching) { + it->set_sensitive( sensitive ); } - for ( std::vector::iterator it = _watchingNonTop.begin(); it != _watchingNonTop.end(); ++it ) { - (*it)->set_sensitive( sensitiveNonTop ); + for (auto & it : _watchingNonTop) { + it->set_sensitive( sensitiveNonTop ); } - for ( std::vector::iterator it = _watchingNonBottom.begin(); it != _watchingNonBottom.end(); ++it ) { - (*it)->set_sensitive( sensitiveNonBottom ); + for (auto & it : _watchingNonBottom) { + it->set_sensitive( sensitiveNonBottom ); } } @@ -1478,9 +1478,8 @@ void ObjectsPanel::_highlightPickerColorMod() guint32 rgba = color.toRGBA32( alpha ); //Set the highlight color for all items in the _highlight_target (all selected items) - for (std::vector::iterator iter = _highlight_target.begin(); iter != _highlight_target.end(); ++iter) + for (auto target : _highlight_target) { - SPItem * target = *iter; target->setHighlightColor(rgba); target->updateRepr(SP_OBJECT_WRITE_NO_CHILDREN | SP_OBJECT_WRITE_EXT); } @@ -1929,14 +1928,14 @@ ObjectsPanel::ObjectsPanel() : // ------------------------------------------------------- //Set initial sensitivity of buttons - for ( std::vector::iterator it = _watching.begin(); it != _watching.end(); ++it ) { - (*it)->set_sensitive( false ); + for (auto & it : _watching) { + it->set_sensitive( false ); } - for ( std::vector::iterator it = _watchingNonTop.begin(); it != _watchingNonTop.end(); ++it ) { - (*it)->set_sensitive( false ); + for (auto & it : _watchingNonTop) { + it->set_sensitive( false ); } - for ( std::vector::iterator it = _watchingNonBottom.begin(); it != _watchingNonBottom.end(); ++it ) { - (*it)->set_sensitive( false ); + for (auto & it : _watchingNonBottom) { + it->set_sensitive( false ); } //Set up the color selection dialog -- cgit v1.2.3