diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:28:01 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:28:01 +0200 |
commit | fe9eb89ebc1b3c33cbac00a3fa095a14faef9113 (patch) | |
tree | 8a3bb620a9acb83fe0057061a86e8f2cb91a9fe1 /wx+/choice_enum.h | |
parent | 5.21 (diff) | |
download | FreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.tar.gz FreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.tar.bz2 FreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.zip |
5.22
Diffstat (limited to 'wx+/choice_enum.h')
-rw-r--r-- | wx+/choice_enum.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/wx+/choice_enum.h b/wx+/choice_enum.h index f780af87..e06931d5 100644 --- a/wx+/choice_enum.h +++ b/wx+/choice_enum.h @@ -44,7 +44,7 @@ struct EnumDescrList descrList.push_back(std::make_pair(value, std::make_pair(text, tooltip))); return *this; } - typedef std::vector<std::pair<Enum, std::pair<wxString, wxString> > > DescrList; + typedef std::vector<std::pair<Enum, std::pair<wxString, wxString>>> DescrList; DescrList descrList; }; template <class Enum> void setEnumVal(const EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value); @@ -71,15 +71,15 @@ void setEnumVal(const EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value) ctrl.Clear(); int selectedPos = 0; - for (typename EnumDescrList<Enum>::DescrList::const_iterator i = mapping.descrList.begin(); i != mapping.descrList.end(); ++i) + for (auto it = mapping.descrList.begin(); it != mapping.descrList.end(); ++it) { - ctrl.Append(i->second.first); - if (i->first == value) + ctrl.Append(it->second.first); + if (it->first == value) { - selectedPos = i - mapping.descrList.begin(); + selectedPos = it - mapping.descrList.begin(); - if (!i->second.second.empty()) - ctrl.SetToolTip(i->second.second); + if (!it->second.second.empty()) + ctrl.SetToolTip(it->second.second); } } @@ -104,9 +104,9 @@ template <class Enum> void updateTooltipEnumVal(const EnumDescrList<Enum>& mappi { const Enum value = getEnumVal(mapping, ctrl); - for (typename EnumDescrList<Enum>::DescrList::const_iterator i = mapping.descrList.begin(); i != mapping.descrList.end(); ++i) - if (i->first == value) - ctrl.SetToolTip(i->second.second); + for (const auto& item : mapping.descrList) + if (item.first == value) + ctrl.SetToolTip(item.second.second); } } |