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