else
{
while (i < end_pos && *i != wxT('>')) ++i;
- textBeginning = i+1;
+ textBeginning = i < end_pos ? i+1 : i;
}
}
else ++i;
}
m_Tags = m_CurTag = NULL;
- delete m_TextPieces;
- m_TextPieces = NULL;
+ wxDELETE(m_TextPieces);
}
void wxHtmlParser::DoParsing()
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;
}
wxString::const_iterator p = start;
// comments begin with "<!--" in HTML 4.0
- if ( p > end - 3 || *++p != '!' || *++p != '-' || *++p != '-' )
+ if ( end - start < 4 || *++p != '!' || *++p != '-' || *++p != '-' )
{
// not a comment at all
return false;