}
while (Cache()[m_CachePos].Key != at);
}
- *end1 = Cache()[m_CachePos].End1;
- *end2 = Cache()[m_CachePos].End2;
- *hasEnding = (Cache()[m_CachePos].type == wxHtmlCacheItem::Type_Normal);
+
+ switch ( Cache()[m_CachePos].type )
+ {
+ case wxHtmlCacheItem::Type_Normal:
+ *end1 = Cache()[m_CachePos].End1;
+ *end2 = Cache()[m_CachePos].End2;
+ *hasEnding = true;
+ break;
+
+ case wxHtmlCacheItem::Type_EndingTag:
+ wxFAIL_MSG("QueryTag called for ending tag - can't be");
+ // but if it does happen, fall through, better than crashing
+
+ case wxHtmlCacheItem::Type_NoMatchingEndingTag:
+ // If input HTML is invalid and there's no closing tag for this
+ // one, pretend that it runs all the way to the end of input
+ *end1 = inputEnd;
+ *end2 = inputEnd;
+ *hasEnding = false;
+ break;
+ }
}
/* Find parameters and their values: */
- wxChar c;
+ wxChar c wxDUMMY_INITIALIZE(0);
// fill-in name, params and begin pos:
wxString::const_iterator i(pos+1);
while ((i < end_pos) &&
((c = *(i++)) != wxT(' ') && c != wxT('\r') &&
c != wxT('\n') && c != wxT('\t') &&
- c != wxT('>')))
+ c != wxT('>') && c != wxT('/')))
{
if ((c >= wxT('a')) && (c <= wxT('z')))
c -= (wxT('a') - wxT('A'));
bool wxHtmlTag::GetParamAsInt(const wxString& par, int *clr) const
{
- if (!HasParam(par)) return false;
+ if ( !HasParam(par) )
+ return false;
+
long i;
- bool succ = GetParam(par).ToLong(&i);
+ if ( !GetParam(par).ToLong(&i) )
+ return false;
+
*clr = (int)i;
- return succ;
+ return true;
}
wxString wxHtmlTag::GetAllParams() const