]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/winpars.cpp
Typos and other fixes
[wxWidgets.git] / src / html / winpars.cpp
index 479401d3924d6219bd6ed1a84cbff8295188d9a1..796489d850e3ed9df6f2ea84bdc305957c6a5dca 100644 (file)
@@ -180,14 +180,32 @@ wxObject* wxHtmlWinParser::GetProduct()
     return top;
 }
 
-bool wxHtmlWinParser::CanOpenURL(const wxString& url) const
+wxFSFile *wxHtmlWinParser::OpenURL(wxHtmlURLType type,
+                                   const wxString& url) const
 {
     // FIXME - normalize the URL to full path before passing to
     //         OnOpeningURL!!
     if ( m_Window )
-        return m_Window->OnOpeningURL(url);
-    else
-        return TRUE;
+    {
+        wxString myurl(url);
+        wxHtmlOpeningStatus status;
+        for (;;)
+        {
+            wxString redirect;
+            status = m_Window->OnOpeningURL(type, myurl, &redirect);
+            if ( status != wxHTML_REDIRECT )
+                break;
+
+            myurl = redirect;
+        }
+
+        if ( status == wxHTML_BLOCK )
+            return NULL;
+
+        return GetFS()->OpenFile(myurl);
+    }
+
+    return wxHtmlParser::OpenURL(type, url);
 }
 
 void wxHtmlWinParser::AddText(const wxChar* txt)