]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
I think the "specific to PostScript" methods have been gone since 2.6, so let's stop...
[wxWidgets.git] / src / common / wincmn.cpp
index d7d64531035fe7c212ee56e8f942b016d8ff9caf..031712592b76b163131661d4b449506a7e2a1553 100644 (file)
@@ -1268,15 +1268,14 @@ bool wxWindowBase::IsDescendant(wxWindowBase* win) const
     // 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;
@@ -2748,6 +2747,8 @@ wxSize wxWindowBase::GetDlgUnitBase() const
 {
     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