Allow wxPropertyGridInterface::ClearSelection() to be called with NULL state (fixes defect #10195)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli 2008-11-18 18:46:30 +00:00
parent 6d9407fec4
commit 3c5c6707de

View File

@ -361,11 +361,16 @@ bool wxPropertyGridInterface::ClearSelection( bool validation )
flags |= wxPG_SEL_NOVALIDATE;
wxPropertyGridPageState* state = m_pState;
wxPropertyGrid* pg = state->GetGrid();
if ( pg->GetState() == state )
return pg->DoSelectProperty(NULL, flags);
else
state->SetSelection(NULL);
if ( state )
{
wxPropertyGrid* pg = state->GetGrid();
if ( pg->GetState() == state )
return pg->DoSelectProperty(NULL, flags);
else
state->SetSelection(NULL);
}
return true;
}