X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4bfa3189651bd06b6866eb220075bbd134b690c6..cc9a39576ab6edb139c9bb77d01f4118853e04d2:/src/html/winpars.cpp?ds=sidebyside diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index ff3f4ea0bd..0dbab9d1f9 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -32,7 +32,7 @@ #include "wx/fontmap.h" #include "wx/log.h" #include "wx/settings.h" -#include "wx/url.h" +#include "wx/uri.h" //----------------------------------------------------------------------------- @@ -193,7 +193,7 @@ void wxHtmlWinParser::InitParser(const wxString& source) */ m_UseLink = false; - m_Link = wxHtmlLinkInfo( wxT(""), wxT("") ); + m_Link = wxHtmlLinkInfo( wxEmptyString ); m_LinkColor.Set(0, 0, 0xFF); m_ActualColor.Set(0, 0, 0); m_Align = wxHTML_ALIGN_LEFT; @@ -257,36 +257,34 @@ wxFSFile *wxHtmlWinParser::OpenURL(wxHtmlURLType type, { wxString myfullurl(myurl); -#if wxUSE_URL // consider url as absolute path first - wxURL current(wxURL::Unescape(myurl)); - myfullurl = current.GetURL(); + wxURI current(myurl); + myfullurl = current.BuildUnescapedURI(); // if not absolute then ... if( current.IsReference() ) { wxString basepath = GetFS()->GetPath(); - wxURI base(wxURL::Unescape(basepath)); + wxURI base(basepath); - // try to apply base path if valid ... + // ... try to apply base path if valid ... if( !base.IsReference() ) { wxURI path(myfullurl); path.Resolve( base ); - myfullurl = path.BuildURI(); + myfullurl = path.BuildUnescapedURI(); } else { // ... or force such addition if not included already - if( !current.GetURL().Contains(basepath) ) + if( !current.GetPath().Contains(base.GetPath()) ) { basepath += myurl; - wxURL connected( wxURL::Unescape(basepath) ); - myfullurl = connected.GetURL(); + wxURI connected( basepath ); + myfullurl = connected.BuildUnescapedURI(); } } } -#endif wxString redirect; status = m_Window->OnOpeningURL(type, myfullurl, &redirect);