X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/78d14f80e9a72041ede52c30d912ec5cef21b1b3..00c813596e3eefdd028365acf9542355937e5531:/src/xrc/xh_html.cpp diff --git a/src/xrc/xh_html.cpp b/src/xrc/xh_html.cpp index affa03f68f..dab79dc4c5 100644 --- a/src/xrc/xh_html.cpp +++ b/src/xrc/xh_html.cpp @@ -24,6 +24,7 @@ #if wxUSE_HTML #include "wx/html/htmlwin.h" +#include "wx/filesys.h" wxHtmlWindowXmlHandler::wxHtmlWindowXmlHandler() @@ -50,8 +51,19 @@ wxObject *wxHtmlWindowXmlHandler::DoCreateResource() if( HasParam( wxT("url") )) { - control->LoadPage( GetParamValue( wxT("url" ))); + wxString url = GetParamValue(wxT("url" )); + wxFileSystem& fsys = GetCurFileSystem(); + + wxFSFile *f = fsys.OpenFile(url); + if (f) + { + control->LoadPage(f->GetLocation()); + delete f; + } + else + control->LoadPage(url); } + else if( HasParam( wxT("htmlcode") )) { control->SetPage( GetText(wxT("htmlcode")) );