summaryrefslogtreecommitdiffstats
path: root/src/attribute-sort-util.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/attribute-sort-util.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/attribute-sort-util.cpp b/src/attribute-sort-util.cpp
index 6dad86007..0e6203ce9 100644
--- a/src/attribute-sort-util.cpp
+++ b/src/attribute-sort-util.cpp
@@ -110,18 +110,16 @@ void sp_attribute_sort_element(Node *repr) {
std::sort(my_list.begin(), my_list.end(), cmp);
// Delete all attributes.
//for (auto it: my_list) {
- for (std::vector<std::pair< Glib::ustring, Glib::ustring > >::iterator it = my_list.begin();
- it != my_list.end(); ++it) {
+ for (auto & it : my_list) {
// Removing "inkscape:label" results in crash when Layers dialog is open.
- if (it->first != "inkscape:label") {
- repr->setAttribute( it->first.c_str(), nullptr, false );
+ if (it.first != "inkscape:label") {
+ repr->setAttribute( it.first.c_str(), nullptr, false );
}
}
// Insert all attributes in proper order
- for (std::vector<std::pair< Glib::ustring, Glib::ustring > >::iterator it = my_list.begin();
- it != my_list.end(); ++it) {
- if (it->first != "inkscape:label") {
- repr->setAttribute( it->first.c_str(), it->second.c_str(), false );
+ for (auto & it : my_list) {
+ if (it.first != "inkscape:label") {
+ repr->setAttribute( it.first.c_str(), it.second.c_str(), false );
}
}
}
@@ -197,14 +195,12 @@ void sp_attribute_sort_style(Node* repr, SPCSSAttr *css) {
std::sort(my_list.begin(), my_list.end(), cmp);
// Delete all attributes.
//for (auto it: my_list) {
- for (std::vector<std::pair< Glib::ustring, Glib::ustring > >::iterator it = my_list.begin();
- it != my_list.end(); ++it) {
- sp_repr_css_set_property( css, it->first.c_str(), nullptr );
+ for (auto & it : my_list) {
+ sp_repr_css_set_property( css, it.first.c_str(), nullptr );
}
// Insert all attributes in proper order
- for (std::vector<std::pair< Glib::ustring, Glib::ustring > >::iterator it = my_list.begin();
- it != my_list.end(); ++it) {
- sp_repr_css_set_property( css, it->first.c_str(), it->second.c_str() );
+ for (auto & it : my_list) {
+ sp_repr_css_set_property( css, it.first.c_str(), it.second.c_str() );
}
}