ENUM_MAP: fix value used as index (should be use as key) bug causing incorrect String<>Enum mappings
This commit is contained in:
parent
fe4695719d
commit
ca17cada2a
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue