From: Vadim Zeitlin Date: Sat, 20 Mar 2004 12:49:43 +0000 (+0000) Subject: reuse existing wxGetTopLevelParent() function in wxMessageDialog ctor instead of... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1840af03190210b05e354ddd043bcd32617d9128 reuse existing wxGetTopLevelParent() function in wxMessageDialog ctor instead of reimplementing it (yes, it is just 4 lines, but this still was enough for a fatal bug to slip in them...) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/msgdlg.cpp b/src/gtk/msgdlg.cpp index 9f61be98d7..9026e34f67 100644 --- a/src/gtk/msgdlg.cpp +++ b/src/gtk/msgdlg.cpp @@ -39,14 +39,7 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent, m_caption = caption; m_message = message; m_dialogStyle = style; - - if (parent) - { - while (!parent->IsTopLevel()) - parent = parent->GetParent(); - } - - m_parent = parent; + m_parent = wxGetTopLevelParent(parent); } int wxMessageDialog::ShowModal() diff --git a/src/gtk1/msgdlg.cpp b/src/gtk1/msgdlg.cpp index 9f61be98d7..9026e34f67 100644 --- a/src/gtk1/msgdlg.cpp +++ b/src/gtk1/msgdlg.cpp @@ -39,14 +39,7 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent, m_caption = caption; m_message = message; m_dialogStyle = style; - - if (parent) - { - while (!parent->IsTopLevel()) - parent = parent->GetParent(); - } - - m_parent = parent; + m_parent = wxGetTopLevelParent(parent); } int wxMessageDialog::ShowModal()