]> git.saurik.com Git - wxWidgets.git/commitdiff
Update wxCommandProcessor after saving wxDocument.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 25 Jan 2012 00:05:15 +0000 (00:05 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 25 Jan 2012 00:05:15 +0000 (00:05 +0000)
Surprisingly, wxCommandProcessor::MarkAsSaved() method was never called by
wxDocument so saving the document didn't update wxCommandProcessor dirty
status.

Do add a call to MarkAsSaved() now, this allows wxCommandProcessor to track
its status correctly (and actually more correctly than the dirty status of the
document which becomes "dirty" after doing and undoing an operation after
saving it, unlike wxCommandProcessor::IsDirty() which correctly returns false
in this case).

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

src/common/docview.cpp

index e4f6bf3bdb2b5f097298e56a8f30be8f83f9ef68..eba884d600cce306ca3bdd636b3fcca7951793ad 100644 (file)
@@ -397,6 +397,9 @@ bool wxDocument::OnSaveDocument(const wxString& file)
     if ( !DoSaveDocument(file) )
         return false;
 
+    if ( m_commandProcessor )
+        m_commandProcessor->MarkAsSaved();
+
     Modify(false);
     SetFilename(file);
     SetDocumentSaved(true);