]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textfile.cpp
toplevel code transferred to wxTopLevelWindow
[wxWidgets.git] / src / common / textfile.cpp
index 77510ace07e8c07a1cd2cec3f4e80615cbf0fe89..63f02f1a37a75105bc23e39e7b68edf877bb620b 100644 (file)
@@ -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);
 }