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:
@@ -35,6 +35,7 @@ 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() )
|
||||||
|
{
|
||||||
|
m_error = wxPROTO_NOERR;
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
} else {
|
|
||||||
delete retval;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_error = wxPROTO_NOFILE;
|
||||||
|
delete retval;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE
|
#endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE
|
||||||
|
Reference in New Issue
Block a user