From b9698194c1dfba8c3ec3737eac492443c4c64545 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 14 Jul 2005 16:02:22 +0000 Subject: [PATCH] set m_lasterror if the file couldn't be opened in wxFileInputStream ctor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/wfstream.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/common/wfstream.cpp b/src/common/wfstream.cpp index 9d15b4f9b6..a142d44f7c 100644 --- a/src/common/wfstream.cpp +++ b/src/common/wfstream.cpp @@ -37,6 +37,8 @@ wxFileInputStream::wxFileInputStream(const wxString& fileName) { m_file = new wxFile(fileName, wxFile::read); m_file_destroy = true; + if ( !m_file->IsOpened() ) + m_lasterror = wxSTREAM_READ_ERROR; } wxFileInputStream::wxFileInputStream() @@ -115,14 +117,7 @@ wxFileOutputStream::wxFileOutputStream(const wxString& fileName) m_file_destroy = true; if (!m_file->IsOpened()) - { m_lasterror = wxSTREAM_WRITE_ERROR; - } - else - { - if (m_file->Error()) - m_lasterror = wxSTREAM_WRITE_ERROR; - } } wxFileOutputStream::wxFileOutputStream(wxFile& file) -- 2.45.2