]> git.saurik.com Git - wxWidgets.git/commitdiff
don't call OnCloseDocument() from OnNewDocument(), this plainly doesn't make sense...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 7 Aug 2008 12:17:52 +0000 (12:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 7 Aug 2008 12:17:52 +0000 (12:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
interface/wx/docview.h
src/common/docview.cpp

index 3dca38bc52fd62d9af01ffa2f918dda57c1fbb9e..44fe563ab128978c628b78339799942a45e68ba1 100644 (file)
@@ -102,6 +102,8 @@ Changes in behaviour not resulting in compilation errors, please read this!
 - Under MSW wxExecute() arguments are now always properly quoted, as under
   Unix, and so shouldn't contain quotes unless they are part of the argument.
 
+- wxDocument::OnNewDocument() doesn't call OnCloseDocument() any more.
+
 Changes in behaviour which may result in compilation errors
 -----------------------------------------------------------
 
index 3a8bc4fddd0d3bacfc5c636fb216f642f7d9df54..dcb80c1f286136e4c8295e990f75741ac6590e8e 100644 (file)
@@ -1122,9 +1122,16 @@ public:
     virtual void OnChangedViewList();
 
     /**
+        This virtual function is called when the document is being closed.
+
         The default implementation calls DeleteContents() (an empty
-        implementation) and sets the modified flag to @false. Override this to
-        supply additional behaviour when the document is closed with Close().
+        implementation) and sets the modified flag to @false. You can override
+        it to supply additional behaviour when the document is closed with
+        Close().
+
+        Notice that previous wxWidgets versions used to call this function also
+        from OnNewDocument(), rather counter-intuitively. This is no longer the
+        case since wxWidgets 2.9.0.
     */
     virtual bool OnCloseDocument();
 
index b493ec91bd716cf552a1e906684d8699a5be0958..5d53187c73137a7333ee367ed12ed3c5edcc6cbd 100644 (file)
@@ -246,8 +246,6 @@ bool wxDocument::OnNewDocument()
     if ( !OnSaveModified() )
         return false;
 
-    if ( !OnCloseDocument() )
-        return false;
     DeleteContents();
     Modify(false);
     SetDocumentSaved(false);