summaryrefslogtreecommitdiffstats
path: root/src/style.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2019-01-02 09:41:30 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2019-01-02 09:41:30 +0000
commit169dff19d4da8d76e69b8e896aa25b0013639c03 (patch)
treea0c070fa95188b5cde708ac285e6a2db9df4a83f /src/style.cpp
parentAvoid creating a new document before opening an old document. (diff)
downloadinkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.tar.gz
inkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.zip
modernize loops
Diffstat (limited to 'src/style.cpp')
-rw-r--r--src/style.cpp16
1 files changed, 8 insertions, 8 deletions
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<Inkscape::Preferences::Entry> attrs = prefs->getAllEntries(path);
- for (std::vector<Inkscape::Preferences::Entry>::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<Glib::ustring> 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<Glib::ustring> 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 ", "