ENUM_MAP: fix value used as index (should be use as key) bug causing incorrect String<>Enum mappings

This commit is contained in:
Tomasz Wlostowski 2020-07-29 23:12:17 +02:00
parent fe4695719d
commit ca17cada2a
1 changed files with 2 additions and 2 deletions

View File

@ -538,10 +538,10 @@ public:
{
static const wxString s_undef = "UNDEFINED";
int idx = static_cast<int>( value );
int idx = m_choices.Index( static_cast<int>( value ) );
if( idx >= 0 && idx < (int) m_choices.GetCount() )
return m_choices.GetLabel( static_cast<int>( value ) );
return m_choices.GetLabel( static_cast<int>( idx ) );
else
return s_undef;
}