X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4311588bfe40e15dc83154b9653ebc432b42baeb..852febd80ec724502cf2c6bea5ad898eb78c4dda:/src/common/docview.cpp diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 265a6e54a6..635a2529bb 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -1114,6 +1114,15 @@ void wxDocManager::OnPrint(wxCommandEvent& WXUNUSED(event)) #endif // wxUSE_PRINTING_ARCHITECTURE } +#if wxUSE_PRINTING_ARCHITECTURE +wxPreviewFrame* wxDocManager::CreatePreviewFrame(wxPrintPreviewBase* preview, + wxWindow *parent, + const wxString& title) +{ + return new wxPreviewFrame(preview, parent, title); +} +#endif // wxUSE_PRINTING_ARCHITECTURE + void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event)) { #if wxUSE_PRINTING_ARCHITECTURE @@ -1135,9 +1144,11 @@ void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event)) return; } - wxPreviewFrame * - frame = new wxPreviewFrame(preview, wxTheApp->GetTopWindow(), - _("Print Preview")); + wxPreviewFrame* frame = CreatePreviewFrame(preview, + wxTheApp->GetTopWindow(), + _("Print Preview")); + wxCHECK_RET( frame, "should create a print preview frame" ); + frame->Centre(wxBOTH); frame->Initialize(); frame->Show(true); @@ -1614,7 +1625,8 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates, GetLastDirectory(), wxEmptyString, &FilterIndex, - descrBuf); + descrBuf, + wxFD_OPEN | wxFD_FILE_MUST_EXIST); wxDocTemplate *theTemplate = NULL; if (!pathTmp.empty())