// Iterate until we find this window in the parent chain or exhaust it.
while ( win )
{
- wxWindow* const parent = win->GetParent();
- if ( parent == this )
+ if ( win == this )
return true;
// Stop iterating on reaching the top level window boundary.
- if ( parent->IsTopLevel() )
+ if ( win->IsTopLevel() )
break;
- win = parent;
+ win = win->GetParent();
}
return false;
{
const wxWindowBase * const parent = wxGetTopLevelParent((wxWindow*)this);
+ wxCHECK_MSG( parent, wxDefaultSize, wxS("Must have TLW parent") );
+
if ( !parent->m_font.IsOk() )
{
// Default GUI font is used. This is the most common case, so