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/style.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/style.cpp') diff --git a/src/style.cpp b/src/style.cpp index b11a92749..bf14d66ce 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -650,8 +650,8 @@ SPStyle::readFromPrefs(Glib::ustring const &path) { Inkscape::XML::Node *tempnode = tempdoc->createElement("prefs"); std::vector attrs = prefs->getAllEntries(path); - for (std::vector::iterator i = attrs.begin(); i != attrs.end(); ++i) { - tempnode->setAttribute(i->getEntryName().data(), i->getString().data()); + for (auto & attr : attrs) { + tempnode->setAttribute(attr.getEntryName().data(), attr.getString().data()); } read( nullptr, tempnode ); @@ -1627,9 +1627,9 @@ css_font_family_quote(Glib::ustring &val) std::vector tokens = Glib::Regex::split_simple("\\s*,\\s*", val ); val.erase(); - for( unsigned i=0; i < tokens.size(); ++i ) { - css_quote( tokens[i] ); - val += tokens[i] + ", "; + for(auto & token : tokens) { + css_quote( token ); + val += token + ", "; } if( val.size() > 1 ) val.erase( val.size() - 2 ); // Remove trailing ", " @@ -1664,9 +1664,9 @@ css_font_family_unquote(Glib::ustring &val) std::vector tokens = Glib::Regex::split_simple("\\s*,\\s*", val ); val.erase(); - for( unsigned i=0; i < tokens.size(); ++i ) { - css_unquote( tokens[i] ); - val += tokens[i] + ", "; + for(auto & token : tokens) { + css_unquote( token ); + val += token + ", "; } if( val.size() > 1 ) val.erase( val.size() - 2 ); // Remove trailing ", " -- cgit v1.2.3