Fix wxEnumProperty unspecified value by taking it into account in GetIndex()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1054,7 +1054,7 @@ bool wxEnumProperty::ValueFromString_( wxVariant& value, const wxString& text, i
|
|||||||
setAsNextIndex = -1;
|
setAsNextIndex = -1;
|
||||||
value = text;
|
value = text;
|
||||||
}
|
}
|
||||||
else if ( m_index != useIndex )
|
else if ( useIndex != GetIndex() )
|
||||||
{
|
{
|
||||||
if ( useIndex != -1 )
|
if ( useIndex != -1 )
|
||||||
{
|
{
|
||||||
@@ -1095,7 +1095,7 @@ bool wxEnumProperty::ValueFromInt_( wxVariant& variant, int intVal, int argFlags
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( m_index != intVal )
|
if ( intVal != GetIndex() )
|
||||||
{
|
{
|
||||||
ms_nextIndex = intVal;
|
ms_nextIndex = intVal;
|
||||||
}
|
}
|
||||||
@@ -1131,8 +1131,12 @@ void wxEnumProperty::SetIndex( int index )
|
|||||||
|
|
||||||
int wxEnumProperty::GetIndex() const
|
int wxEnumProperty::GetIndex() const
|
||||||
{
|
{
|
||||||
|
if ( m_value.IsNull() )
|
||||||
|
return -1;
|
||||||
|
|
||||||
if ( ms_nextIndex != -2 )
|
if ( ms_nextIndex != -2 )
|
||||||
return ms_nextIndex;
|
return ms_nextIndex;
|
||||||
|
|
||||||
return m_index;
|
return m_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user