Fix wxPGProperty::GetMainParent() function

Traversing upwards in the tree should be stopped when parent is root or category property.
This commit is contained in:
Artur Wieczorek 2018-10-13 11:27:27 +02:00
parent a33b364d84
commit 7a7777cb4a

View File

@ -2254,7 +2254,7 @@ wxPGProperty* wxPGProperty::GetMainParent() const
const wxPGProperty* curChild = this; const wxPGProperty* curChild = this;
const wxPGProperty* curParent = m_parent; const wxPGProperty* curParent = m_parent;
while ( curParent && !curParent->IsCategory() ) while ( !curParent->IsRoot() && !curParent->IsCategory() )
{ {
curChild = curParent; curChild = curParent;
curParent = curParent->m_parent; curParent = curParent->m_parent;