fix the problem with parsing HTML comments (closes bug 1116708; based on patch 1168583)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45336 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-04-08 21:02:03 +00:00
parent 132276cf0d
commit 4609ee2ef8
3 changed files with 72 additions and 27 deletions

View File

@@ -68,11 +68,18 @@ wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source)
m_CacheSize = 0;
m_CachePos = 0;
int pos = 0;
while (pos < lng)
for ( int pos = 0; pos < lng; pos++ )
{
if (src[pos] == wxT('<')) // tag found:
{
// don't cache comment tags
wxString::const_iterator iter = source.begin() + pos;
if ( wxHtmlParser::SkipCommentTag(iter, source.end()) )
{
pos = iter - source.begin();
continue;
}
if (m_CacheSize % CACHE_INCREMENT == 0)
m_Cache = (wxHtmlCacheItem*) realloc(m_Cache, (m_CacheSize + CACHE_INCREMENT) * sizeof(wxHtmlCacheItem));
int tg = m_CacheSize++;
@@ -169,8 +176,6 @@ wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source)
}
}
}
pos++;
}
// ok, we're done, now we'll free .Name members of cache - we don't need it anymore: