]> git.saurik.com Git - wxWidgets.git/commitdiff
Just call wxDocManager::CloseDocument() instead of duplicating it.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 23 Jul 2010 23:33:32 +0000 (23:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 23 Jul 2010 23:33:32 +0000 (23:33 +0000)
No real changes but avoid making the document deletion code even more opaque
by duplicating the code already existing as a function elsewhere.

Closes #11364.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/docview.cpp

index 6544987b1b6cfc81b6855fc5911a354e5d335a70..2111cfd22f6e8d477e0dabdc789315eaadff9b8f 100644 (file)
@@ -1036,14 +1036,8 @@ wxFileHistory *wxDocManager::OnCreateFileHistory()
 void wxDocManager::OnFileClose(wxCommandEvent& WXUNUSED(event))
 {
     wxDocument *doc = GetCurrentDocument();
-    if (!doc)
-        return;
-    if (doc->Close())
-    {
-        doc->DeleteAllViews();
-        if (m_docs.Member(doc))
-            delete doc;
-    }
+    if (doc)
+        CloseDocument(doc);
 }
 
 void wxDocManager::OnFileCloseAll(wxCommandEvent& WXUNUSED(event))