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/tools/text-tool.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/ui/tools/text-tool.cpp') diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp index 4de0dc81f..f27f37300 100644 --- a/src/ui/tools/text-tool.cpp +++ b/src/ui/tools/text-tool.cpp @@ -244,10 +244,9 @@ void TextTool::finish() { this->frame = nullptr; } - for (std::vector::iterator it = this->text_selection_quads.begin() ; - it != this->text_selection_quads.end() ; ++it) { - sp_canvas_item_hide(*it); - sp_canvas_item_destroy(*it); + for (auto & text_selection_quad : this->text_selection_quads) { + sp_canvas_item_hide(text_selection_quad); + sp_canvas_item_destroy(text_selection_quad); } this->text_selection_quads.clear(); @@ -1702,9 +1701,9 @@ static void sp_text_context_update_text_selection(TextTool *tc) // the selection update (can't do both atomically, alas) if (!tc->desktop) return; - for (std::vector::iterator it = tc->text_selection_quads.begin() ; it != tc->text_selection_quads.end() ; ++it) { - sp_canvas_item_hide(*it); - sp_canvas_item_destroy(*it); + for (auto & text_selection_quad : tc->text_selection_quads) { + sp_canvas_item_hide(text_selection_quad); + sp_canvas_item_destroy(text_selection_quad); } tc->text_selection_quads.clear(); -- cgit v1.2.3