X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/27752aab2a347fe56975291ef933874c7e3c308b..88594d02eb59a55ac85d3210a49d02918124617b:/src/common/textfile.cpp?ds=sidebyside diff --git a/src/common/textfile.cpp b/src/common/textfile.cpp index 77510ace07..63f02f1a37 100644 --- a/src/common/textfile.cpp +++ b/src/common/textfile.cpp @@ -61,21 +61,22 @@ bool wxTextFile::OnExists() const bool wxTextFile::OnOpen(const wxString &strBufferName, wxTextBufferOpenMode OpenMode) { - wxFile::OpenMode FileOpenMode = wxFile::read; - int nAssertVal = 0; + wxFile::OpenMode FileOpenMode; + + switch ( OpenMode ) + { + default: + wxFAIL_MSG( _T("unknown open mode in wxTextFile::Open") ); + // fall through - switch (OpenMode) - { case ReadAccess : FileOpenMode = wxFile::read; break; + case WriteAccess : FileOpenMode = wxFile::write; break; - default : - wxASSERT(nAssertVal); // Should not happen. - break; - } + } return m_file.Open(strBufferName.c_str(), FileOpenMode); }