Check if PG exists before adding or deleting a choice to wxPGProperty.
Because choice value can be added/deleted also to/from detached property object there is necessary to skip in wxPGProperty::InsertChoice and wxPGProperty::DeleteChoice the operations which are valid exclusively for property attached to the property grid. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76969 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
960eedb920
commit
a07734febf
@ -1900,7 +1900,7 @@ int wxPGProperty::InsertChoice( const wxString& label, int index, int value )
|
||||
if ( sel != newSel )
|
||||
SetChoiceSelection(newSel);
|
||||
|
||||
if ( this == pg->GetSelection() )
|
||||
if ( pg && this == pg->GetSelection() )
|
||||
GetEditorClass()->InsertItem(pg->GetEditorControl(),label,index);
|
||||
|
||||
return index;
|
||||
@ -1930,7 +1930,7 @@ void wxPGProperty::DeleteChoice( int index )
|
||||
if ( sel != newSel )
|
||||
SetChoiceSelection(newSel);
|
||||
|
||||
if ( this == pg->GetSelection() )
|
||||
if ( pg && this == pg->GetSelection() )
|
||||
GetEditorClass()->DeleteItem(pg->GetEditorControl(), index);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user