]> git.saurik.com Git - wxWidgets.git/commitdiff
remove unneeded wxFindSuitableParent()
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 9 May 2009 12:57:00 +0000 (12:57 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 9 May 2009 12:57:00 +0000 (12:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/docview.cpp

index c00db551ce9522807bfa2c88076ab3306f5c5c4d..11d6bca96d17631d078784eb03f53a22d11893c3 100644 (file)
@@ -105,13 +105,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxFileHistory, wxObject)
 namespace
 {
 
-wxWindow *wxFindSuitableParent()
-{
-    wxWindow * const win = wxGetTopLevelParent(wxWindow::FindFocus());
-
-    return win ? win : wxTheApp->GetTopWindow();
-}
-
 wxString FindExtension(const wxString& path)
 {
     wxString ext;
@@ -489,8 +482,7 @@ bool wxDocument::OnSaveModified()
                      GetUserReadableName()
                     ),
                     wxTheApp->GetAppDisplayName(),
-                    wxYES_NO | wxCANCEL | wxICON_QUESTION | wxCENTRE,
-                    wxFindSuitableParent()
+                    wxYES_NO | wxCANCEL | wxICON_QUESTION | wxCENTRE
                  ) )
         {
             case wxNO:
@@ -1566,15 +1558,11 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
 
     int FilterIndex = -1;
 
-    wxWindow* parent = wxFindSuitableParent();
-
     wxString pathTmp = wxFileSelectorEx(_("Open File"),
                                         GetLastDirectory(),
                                         wxEmptyString,
                                         &FilterIndex,
-                                        descrBuf,
-                                        0,
-                                        parent);
+                                        descrBuf);
 
     wxDocTemplate *theTemplate = NULL;
     if (!pathTmp.empty())
@@ -1589,8 +1577,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
 
             wxMessageBox(_("Sorry, could not open this file."),
                          msgTitle,
-                         wxOK | wxICON_EXCLAMATION | wxCENTRE,
-                         parent);
+                         wxOK | wxICON_EXCLAMATION | wxCENTRE);
 
             path = wxEmptyString;
             return NULL;
@@ -1613,8 +1600,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
             // allowed templates in runtime.
             wxMessageBox(_("Sorry, the format for this file is unknown."),
                          _("Open File"),
-                         wxOK | wxICON_EXCLAMATION | wxCENTRE,
-                         parent);
+                         wxOK | wxICON_EXCLAMATION | wxCENTRE);
         }
     }
     else
@@ -1696,8 +1682,7 @@ wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates,
                             _("Select a document template"),
                             _("Templates"),
                             strings,
-                            (void **)data.get(),
-                            wxFindSuitableParent()
+                            (void **)data.get()
                           );
     }
 
@@ -1771,8 +1756,7 @@ wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates,
                             _("Select a document view"),
                             _("Views"),
                             strings,
-                            (void **)data.get(),
-                            wxFindSuitableParent()
+                            (void **)data.get()
                           );
 
     }