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
This commit is contained in:
Vadim Zeitlin 2005-07-14 16:02:22 +00:00
parent f8be01b1ac
commit b9698194c1

View File

@ -37,6 +37,8 @@ wxFileInputStream::wxFileInputStream(const wxString& fileName)
{ {
m_file = new wxFile(fileName, wxFile::read); m_file = new wxFile(fileName, wxFile::read);
m_file_destroy = true; m_file_destroy = true;
if ( !m_file->IsOpened() )
m_lasterror = wxSTREAM_READ_ERROR;
} }
wxFileInputStream::wxFileInputStream() wxFileInputStream::wxFileInputStream()
@ -115,15 +117,8 @@ wxFileOutputStream::wxFileOutputStream(const wxString& fileName)
m_file_destroy = true; m_file_destroy = true;
if (!m_file->IsOpened()) if (!m_file->IsOpened())
{
m_lasterror = wxSTREAM_WRITE_ERROR; m_lasterror = wxSTREAM_WRITE_ERROR;
} }
else
{
if (m_file->Error())
m_lasterror = wxSTREAM_WRITE_ERROR;
}
}
wxFileOutputStream::wxFileOutputStream(wxFile& file) wxFileOutputStream::wxFileOutputStream(wxFile& file)
{ {