diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 101ee980ba..d14dc9130f 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -1030,12 +1030,8 @@ wxString wxPGProperty::GetValueAsString( int argFlags ) const } #endif wxPropertyGrid* pg = GetGrid(); - wxASSERT_MSG( pg, - wxS("Cannot get valid value for detached property") ); - if ( !pg ) - { - return wxEmptyString; - } + wxCHECK_MSG( pg, wxEmptyString, + wxS("Cannot get valid value for detached property") ); if ( IsValueUnspecified() ) return pg->GetUnspecifiedValueText(argFlags); @@ -2288,9 +2284,9 @@ int wxPGProperty::GetY2( int lh ) const int wxPGProperty::GetY() const { wxPropertyGrid *pg = GetGrid(); - wxASSERT_MSG( pg, - wxS("Cannot obtain coordinates of detached property") ); - return pg ? GetY2(pg->GetRowHeight()) : 0; + wxCHECK_MSG( pg, 0, + wxS("Cannot obtain coordinates of detached property") ); + return GetY2(pg->GetRowHeight()); } // This is used by Insert etc. @@ -2616,12 +2612,8 @@ void wxPGProperty::Empty() wxPGProperty* wxPGProperty::GetItemAtY( unsigned int y ) const { wxPropertyGrid *pg = GetGrid(); - wxASSERT_MSG( pg, - wxS("Cannot obtain property item for detached property") ); - if( !pg ) - { - return NULL; - } + wxCHECK_MSG( pg, NULL, + wxS("Cannot obtain property item for detached property") ); unsigned int nextItem = 0; return GetItemAtY(y, pg->GetRowHeight(), &nextItem);