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