From 954ee459b4230fc1fc0b6aeb2fe34239fb8b4f08 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Tue, 8 Jul 2014 15:56:34 +0000 Subject: [PATCH] Fix wxEnumProperty::GetIndexForValue GetIndexForValue should indicate that given property value does not exist by returning special index value(-1). Closes #14450. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/props.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index 025d62ff49..9fe5672877 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -1171,11 +1171,11 @@ int wxEnumProperty::GetIndexForValue( int value ) const if ( !m_choices.IsOk() ) return -1; - int intVal = m_choices.Index(value); + const int intVal = m_choices.Index(value); if ( intVal >= 0 ) return intVal; - return value; + return -1; } wxEnumProperty::~wxEnumProperty ()