Use wxVariant::IsType() function to check the type of variant values in wxPG.
Since there is a dedicated function to check the type of variant then there is not necessary to call wxVariant::GetType() function and perform explicit comparisons of returned strings.
This commit is contained in:
@@ -2999,7 +2999,7 @@ bool wxPropertyGrid::PerformValidation( wxPGProperty* p, wxVariant& pendingValue
|
||||
//
|
||||
// Variant list a special value that cannot be validated
|
||||
// by normal means.
|
||||
if ( pendingValue.GetType() != wxPG_VARIANT_TYPE_LIST )
|
||||
if ( !pendingValue.IsType(wxPG_VARIANT_TYPE_LIST) )
|
||||
{
|
||||
if ( !p->ValidateValue(pendingValue, m_validationInfo) )
|
||||
return false;
|
||||
@@ -3045,7 +3045,7 @@ bool wxPropertyGrid::PerformValidation( wxPGProperty* p, wxVariant& pendingValue
|
||||
wxVariant value;
|
||||
wxPGProperty* evtChangingProperty = changedProperty;
|
||||
|
||||
if ( pPendingValue->GetType() != wxPG_VARIANT_TYPE_LIST )
|
||||
if ( !pPendingValue->IsType(wxPG_VARIANT_TYPE_LIST) )
|
||||
{
|
||||
value = *pPendingValue;
|
||||
}
|
||||
@@ -3104,7 +3104,7 @@ bool wxPropertyGrid::PerformValidation( wxPGProperty* p, wxVariant& pendingValue
|
||||
|
||||
// If changedProperty is not property which value was edited,
|
||||
// then call wxPGProperty::ValidateValue() for that as well.
|
||||
if ( p != changedProperty && value.GetType() != wxPG_VARIANT_TYPE_LIST )
|
||||
if ( p != changedProperty && !value.IsType(wxPG_VARIANT_TYPE_LIST) )
|
||||
{
|
||||
if ( !changedProperty->ValidateValue(value, m_validationInfo) )
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user