set m_error correctly (patch 1249848)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35138 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-08-06 21:35:12 +00:00
parent 4a712ba3cf
commit 3a0827804b

View File

@@ -33,8 +33,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol)
IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, false) IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, false)
wxFileProto::wxFileProto() wxFileProto::wxFileProto()
: wxProtocol() : wxProtocol()
{ {
m_error = wxPROTO_NOERR;
} }
wxFileProto::~wxFileProto() wxFileProto::~wxFileProto()
@@ -43,13 +44,18 @@ wxFileProto::~wxFileProto()
wxInputStream *wxFileProto::GetInputStream(const wxString& path) wxInputStream *wxFileProto::GetInputStream(const wxString& path)
{ {
wxFileInputStream* retval = new wxFileInputStream(wxURI::Unescape(path)); wxFileInputStream *retval = new wxFileInputStream(wxURI::Unescape(path));
if (retval->Ok()) { if ( retval->Ok() )
return retval; {
} else { m_error = wxPROTO_NOERR;
return retval;
}
m_error = wxPROTO_NOFILE;
delete retval; delete retval;
return 0;
} return NULL;
} }
#endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE #endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE