From d06a66f52670ed5258b6a1dcf52ed5cd3a06ae1a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 30 Dec 2001 17:28:12 +0000 Subject: [PATCH] wxDocument::SaveAs sets m_savedYet flag correctly (patch 494838) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/docview.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 7588bcd..95b9f93 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -227,16 +227,13 @@ bool wxDocument::OnNewDocument() bool wxDocument::Save() { - bool ret = FALSE; + if (!IsModified() && m_savedYet) + return TRUE; - if (!IsModified() && m_savedYet) return TRUE; - if (m_documentFile == wxT("") || !m_savedYet) - ret = SaveAs(); - else - ret = OnSaveDocument(m_documentFile); - if ( ret ) - SetDocumentSaved(TRUE); - return ret; + if ( m_documentFile.empty() || !m_savedYet ) + return SaveAs(); + + return OnSaveDocument(m_documentFile); } bool wxDocument::SaveAs() @@ -316,6 +313,7 @@ bool wxDocument::OnSaveDocument(const wxString& file) } Modify(FALSE); SetFilename(file); + SetDocumentSaved(TRUE); return TRUE; } -- 2.7.4