X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8d94819c437fdf28c45e9f328e6c38fd1c639ddf..e83c4d401206ff9d5568f03ade6d9713c57bdd51:/src/html/htmlpars.cpp?ds=inline diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index 3c312275a7..dad3f09a42 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -227,7 +227,7 @@ void wxHtmlParser::CreateDOMSubTree(wxHtmlTag *cur, else { while (i < end_pos && *i != wxT('>')) ++i; - textBeginning = i+1; + textBeginning = i < end_pos ? i+1 : i; } } else ++i; @@ -250,8 +250,7 @@ void wxHtmlParser::DestroyDOMTree() } m_Tags = m_CurTag = NULL; - delete m_TextPieces; - m_TextPieces = NULL; + wxDELETE(m_TextPieces); } void wxHtmlParser::DoParsing() @@ -870,10 +869,14 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const return GetCharForCode(code); } -wxFSFile *wxHtmlParser::OpenURL(wxHtmlURLType WXUNUSED(type), +wxFSFile *wxHtmlParser::OpenURL(wxHtmlURLType type, const wxString& url) const { - return m_FS ? m_FS->OpenFile(url) : NULL; + int flags = wxFS_READ; + if (type == wxHTML_URL_IMAGE) + flags |= wxFS_SEEKABLE; + + return m_FS ? m_FS->OpenFile(url, flags) : NULL; } @@ -954,12 +957,14 @@ wxHtmlParser::SkipCommentTag(wxString::const_iterator& start, wxString::const_iterator p = start; - // comments begin with "