X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/112d941fe1e012b646386ae9ce734eaf2b403663..bced985eb03eb774a1e5337ed8b1fa7d662d11a3:/samples/docview/doc.cpp diff --git a/samples/docview/doc.cpp b/samples/docview/doc.cpp index d6f77344e5..4892856fe0 100644 --- a/samples/docview/doc.cpp +++ b/samples/docview/doc.cpp @@ -193,7 +193,7 @@ bool wxTextDocument::OnCreate(const wxString& path, long flags) return true; } - + // Since text windows have their own method for saving to/loading from files, // we override DoSave/OpenDocument instead of Save/LoadObject bool wxTextDocument::DoSaveDocument(const wxString& filename) @@ -203,7 +203,13 @@ bool wxTextDocument::DoSaveDocument(const wxString& filename) bool wxTextDocument::DoOpenDocument(const wxString& filename) { - return GetTextCtrl()->LoadFile(filename); + if ( !GetTextCtrl()->LoadFile(filename) ) + return false; + + // we're not modified by the user yet + Modify(false); + + return true; } bool wxTextDocument::IsModified() const