diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-01-02 09:41:30 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-01-02 09:41:30 +0000 |
| commit | 169dff19d4da8d76e69b8e896aa25b0013639c03 (patch) | |
| tree | a0c070fa95188b5cde708ac285e6a2db9df4a83f /src/verbs.cpp | |
| parent | Avoid creating a new document before opening an old document. (diff) | |
| download | inkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.tar.gz inkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.zip | |
modernize loops
Diffstat (limited to 'src/verbs.cpp')
| -rw-r--r-- | src/verbs.cpp | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/src/verbs.cpp b/src/verbs.cpp index 8ee8d671d..37ec08ee4 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -672,11 +672,9 @@ void Verb::sensitive(SPDocument *in_doc, bool in_sensitive) { // printf("Setting sensitivity of \"%s\" to %d\n", _name, in_sensitive); if (_actions != nullptr) { - for (ActionTable::iterator cur_action = _actions->begin(); - cur_action != _actions->end(); - ++cur_action) { - if (in_doc == nullptr || (cur_action->first != nullptr && cur_action->first->doc() == in_doc)) { - sp_action_set_sensitive(cur_action->second, in_sensitive ? 1 : 0); + for (auto & _action : *_actions) { + if (in_doc == nullptr || (_action.first != nullptr && _action.first->doc() == in_doc)) { + sp_action_set_sensitive(_action.second, in_sensitive ? 1 : 0); } } } @@ -721,11 +719,9 @@ void Verb::name(SPDocument *in_doc, Glib::ustring in_name) { if (_actions != nullptr) { - for (ActionTable::iterator cur_action = _actions->begin(); - cur_action != _actions->end(); - ++cur_action) { - if (in_doc == nullptr || (cur_action->first != nullptr && cur_action->first->doc() == in_doc)) { - sp_action_set_name(cur_action->second, in_name); + for (auto & _action : *_actions) { + if (in_doc == nullptr || (_action.first != nullptr && _action.first->doc() == in_doc)) { + sp_action_set_name(_action.second, in_name); } } } @@ -781,9 +777,8 @@ void Verb::delete_all_view(Inkscape::UI::View::View *view) } if (!_verbs.empty()) { - for (VerbTable::iterator thisverb = _verbs.begin(); - thisverb != _verbs.end(); ++thisverb) { - Inkscape::Verb *verbpntr = thisverb->second; + for (auto & _verb : _verbs) { + Inkscape::Verb *verbpntr = _verb.second; // std::cout << "Delete In Verb: " << verbpntr->_name << std::endl; verbpntr->delete_view(view); } @@ -3332,8 +3327,8 @@ Verb::getList () { std::vector<Verb *> verbs; // Go through the dynamic verb table - for (VerbTable::iterator iter = _verbs.begin(); iter != _verbs.end(); ++iter) { - Verb * verb = iter->second; + for (auto & _verb : _verbs) { + Verb * verb = _verb.second; if (verb->get_code() == SP_VERB_INVALID || verb->get_code() == SP_VERB_NONE || verb->get_code() == SP_VERB_LAST) { @@ -3349,8 +3344,8 @@ Verb::getList () { void Verb::list () { // Go through the dynamic verb table - for (VerbTable::iterator iter = _verbs.begin(); iter != _verbs.end(); ++iter) { - Verb * verb = iter->second; + for (auto & _verb : _verbs) { + Verb * verb = _verb.second; if (verb->get_code() == SP_VERB_INVALID || verb->get_code() == SP_VERB_NONE || verb->get_code() == SP_VERB_LAST) { |
