X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5276b0a53cef4815230e39b54d2ecda14f72cbd1..d4d83a46a96e33d011b9e5974951f6ebcb2d9d43:/src/html/htmlpars.cpp diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index 2076129925..0e38da7bc4 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -2,7 +2,6 @@ // Name: src/html/htmlpars.cpp // Purpose: wxHtmlParser class (generic parser) // Author: Vaclav Slavik -// RCS-ID: $Id$ // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -227,7 +226,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; @@ -869,10 +868,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; } @@ -953,12 +956,14 @@ wxHtmlParser::SkipCommentTag(wxString::const_iterator& start, wxString::const_iterator p = start; - // comments begin with "