]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_html.cpp
another segfault fix
[wxWidgets.git] / src / xrc / xh_html.cpp
index affa03f68f932c35ae64800f099d98eae0d8b6f6..53b0808bdf1ff5382e2ebd174607fb7608f48bff 100644 (file)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        xh_html.cpp
-// Purpose:     XML resource for wxHtmlWindow
+// Purpose:     XRC resource for wxHtmlWindow
 // Author:      Bob Mitchell
 // Created:     2000/03/21
 // RCS-ID:      $Id$
@@ -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")) );