Implement new wxPGProperty::HasAnyChild() method

There are many checks in the code whether wxPGProperty has any child.
Doing so by checking if GetChildCount() is greater than zero doesn't
seem to express intent simply and clearly. With dedicated method this
could be done simpler and hopefully in a more optimal way.
This commit is contained in:
Artur Wieczorek 2022-12-03 17:10:55 +02:00
parent d0d43165c9
commit 1d85e22543
12 changed files with 69 additions and 56 deletions

View file

@ -1357,7 +1357,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
if ( pgman->GetPageCount() )
RT_FAILURE();
if ( pgman->GetGrid()->GetRoot()->GetChildCount() )
if ( pgman->GetGrid()->GetRoot()->HasAnyChild() )
RT_FAILURE();
// Recreate the original grid
@ -1368,7 +1368,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
pgman->SelectProperty("Label");
pgman->GetGrid()->Clear();
if ( pgman->GetGrid()->GetRoot()->GetChildCount() )
if ( pgman->GetGrid()->GetRoot()->HasAnyChild() )
RT_FAILURE();
// Recreate the original grid