From b6e96faf3eb7b8bda2b1d7fc8aac4e212607da31 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 May 2009 12:57:00 +0000 Subject: [PATCH] remove unneeded wxFindSuitableParent() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/docview.cpp | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/src/common/docview.cpp b/src/common/docview.cpp index c00db551ce..11d6bca96d 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -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() ); } -- 2.45.2