diff --git a/interface/wx/propgrid/propgrid.h b/interface/wx/propgrid/propgrid.h index 3993ada9b2..6e6052d235 100644 --- a/interface/wx/propgrid/propgrid.h +++ b/interface/wx/propgrid/propgrid.h @@ -926,6 +926,8 @@ public: /** Redraws given property. + + @param p Valid, i.e. non-@NULL, property pointer. */ virtual void RefreshProperty( wxPGProperty* p ); @@ -1143,6 +1145,8 @@ public: /** Draws item, children, and consecutive parents as long as category is not met. + + @param p Valid, i.e. non-@NULL, property pointer. */ void DrawItemAndValueRelated( wxPGProperty* p ); diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index b92a6c0bef..a1ed7af8be 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -1378,7 +1378,8 @@ void wxPropertyGrid::OnDPIChanged(wxDPIChangedEvent &event) CalculateFontAndBitmapStuff(m_vspacing); Refresh(); - RefreshProperty(GetSelection()); + if ( wxPGProperty* const selected = GetSelection() ) + RefreshProperty(selected); event.Skip(); } @@ -2567,6 +2568,8 @@ void wxPropertyGrid::DrawItems( const wxPGProperty* p1, const wxPGProperty* p2 ) void wxPropertyGrid::RefreshProperty( wxPGProperty* p ) { + wxCHECK_RET( p, wxS("invalid property id") ); + if ( m_pState->DoIsPropertySelected(p) || p->IsChildSelected(true) ) { // NB: We must copy the selection. @@ -2585,6 +2588,8 @@ void wxPropertyGrid::RefreshProperty( wxPGProperty* p ) void wxPropertyGrid::DrawItemAndValueRelated( wxPGProperty* p ) { + wxCHECK_RET( p, wxS("invalid property id") ); + if ( IsFrozen() ) return;