summaryrefslogtreecommitdiff
path: root/wx+/choice_enum.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2021-05-10 12:09:24 +0000
committerB. Stack <bgstack15@gmail.com>2021-05-10 12:09:24 +0000
commit692fd264ae30b5b844f748626262e79bc3d5a7e2 (patch)
tree9261c60b81eb28e068f0f2f44fd8e60214462b2a /wx+/choice_enum.h
parentMerge branch '11.9' into 'master' (diff)
parentadd upstream 11.10 (diff)
downloadFreeFileSync-11.10.tar.gz
FreeFileSync-11.10.tar.bz2
FreeFileSync-11.10.zip
Merge branch '11.10' into 'master'11.10
add upstream 11.10 See merge request opensource-tracking/FreeFileSync!33
Diffstat (limited to 'wx+/choice_enum.h')
-rw-r--r--wx+/choice_enum.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/wx+/choice_enum.h b/wx+/choice_enum.h
index a590861a..a25bf104 100644
--- a/wx+/choice_enum.h
+++ b/wx+/choice_enum.h
@@ -48,7 +48,7 @@ struct EnumDescrList
using DescrList = std::vector<std::pair<Enum, std::pair<wxString, wxString>>>;
DescrList descrList;
- std::unordered_map<const wxChoice*, std::vector<wxString>> itemsSetLast;
+ std::unordered_map<const wxChoice*, std::vector<wxString>> labelsSetLast;
};
template <class Enum> void setEnumVal(const EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value);
template <class Enum> Enum getEnumVal(const EnumDescrList<Enum>& mapping, const wxChoice& ctrl);
@@ -71,16 +71,16 @@ template <class Enum> void updateTooltipEnumVal(const EnumDescrList<Enum>& mappi
template <class Enum>
void setEnumVal(EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value)
{
- auto& itemsSetLast = mapping.itemsSetLast[&ctrl];
+ auto& labelsSetLast = mapping.labelsSetLast[&ctrl];
- std::vector<wxString> items;
- for (auto it = mapping.descrList.begin(); it != mapping.descrList.end(); ++it)
- items.push_back(it->second.first);
+ std::vector<wxString> labels;
+ for (const auto& [val, texts] : mapping.descrList)
+ labels.push_back(texts.first);
- if (items != itemsSetLast)
+ if (labels != labelsSetLast)
{
- ctrl.Set(items); //expensive as fuck! => only call when absolutely needed!
- itemsSetLast = std::move(items);
+ ctrl.Set(labels); //expensive as fuck! => only call when absolutely needed!
+ labelsSetLast = std::move(labels);
}
//-----------------------------------------------------------------
bgstack15