X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fbfe2d4e7caa118e1b609151bc72e7e5c7ac0f32..7d605004a217d4f4ef674d7edf073982d8931995:/src/propgrid/propgridpagestate.cpp?ds=sidebyside diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index 859dff0d51..e7cb9539a2 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -55,6 +55,7 @@ #include #include +#include #define wxPG_DEFAULT_SPLITTERX 110 @@ -399,7 +400,8 @@ wxPGProperty* wxPropertyGridPageState::GetLastItem( int flags ) if ( pwc->GetFlags() & itemExMask ) { wxPropertyGridIterator it( this, flags, pwc ); - for ( ; !it.AtEnd(); it.Prev() ); + for ( ; !it.AtEnd(); it.Prev() ) + ; pwc = (wxPGProperty*) it.GetProperty(); } @@ -1501,6 +1503,12 @@ int wxPropertyGridPageState::PrepareToAddItem( wxPGProperty* property, if ( scheduledParent == m_properties ) scheduledParent = (wxPGProperty*) NULL; + if ( scheduledParent && !scheduledParent->IsCategory() ) + { + wxASSERT_MSG( property->GetBaseName().length(), + "Property's children must have unique, non-empty names within their scope" ); + } + property->m_parentState = this; if ( property->IsCategory() )