X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/68379eaf0ae64d105f8244b1db83e793f7dd83b0..6b5403c8d65be699529995d221c3119f1da353c8:/src/common/docview.cpp?ds=sidebyside diff --git a/src/common/docview.cpp b/src/common/docview.cpp index ed5f74fa68..551e02f516 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -187,17 +187,15 @@ bool wxDocument::DeleteAllViews() for ( it = m_documentViews.begin(), en = m_documentViews.end(); it != en; - ) + ++it ) { wxView *view = (wxView *)*it; if (!view->Close()) return false; - wxList::iterator next = it; ++next; - delete view; // Deletes node implicitly - it = next; } + // If we haven't yet deleted the document (for example // if there were no views) then delete it. if (manager && manager->GetDocuments().Member(this)) @@ -837,11 +835,9 @@ BEGIN_EVENT_TABLE(wxDocManager, wxEvtHandler) #if wxUSE_PRINTING_ARCHITECTURE EVT_MENU(wxID_PRINT, wxDocManager::OnPrint) - EVT_MENU(wxID_PRINT_SETUP, wxDocManager::OnPrintSetup) EVT_MENU(wxID_PREVIEW, wxDocManager::OnPreview) EVT_UPDATE_UI(wxID_PRINT, wxDocManager::OnUpdatePrint) - EVT_UPDATE_UI(wxID_PRINT_SETUP, wxDocManager::OnUpdatePrintSetup) EVT_UPDATE_UI(wxID_PREVIEW, wxDocManager::OnUpdatePreview) #endif END_EVENT_TABLE() @@ -1005,22 +1001,6 @@ void wxDocManager::OnPrint(wxCommandEvent& WXUNUSED(event)) #endif // wxUSE_PRINTING_ARCHITECTURE } -void wxDocManager::OnPrintSetup(wxCommandEvent& WXUNUSED(event)) -{ -#if wxUSE_PRINTING_ARCHITECTURE - wxWindow *parentWin = wxTheApp->GetTopWindow(); - wxView *view = GetCurrentView(); - if (view) - parentWin = view->GetFrame(); - - wxPrintDialogData data; - - wxPrintDialog printerDialog(parentWin, &data); - printerDialog.GetPrintDialogData().SetSetupDialog(true); - printerDialog.ShowModal(); -#endif // wxUSE_PRINTING_ARCHITECTURE -} - void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event)) { #if wxUSE_PRINTING_ARCHITECTURE @@ -1141,11 +1121,6 @@ void wxDocManager::OnUpdatePrint(wxUpdateUIEvent& event) event.Enable( (doc != (wxDocument*) NULL) ); } -void wxDocManager::OnUpdatePrintSetup(wxUpdateUIEvent& event) -{ - event.Enable( true ); -} - void wxDocManager::OnUpdatePreview(wxUpdateUIEvent& event) { wxDocument *doc = GetCurrentDocument(); @@ -1839,10 +1814,6 @@ wxDocChildFrame::wxDocChildFrame(wxDocument *doc, view->SetFrame(this); } -wxDocChildFrame::~wxDocChildFrame() -{ -} - // Extend event processing to search the view's event table bool wxDocChildFrame::ProcessEvent(wxEvent& event) {