X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fbfb8bcc3fa17e079d4219655b173f8ed2ccc65a..27b436242eb0257ef471839961250bb3f184fafc:/src/html/htmlpars.cpp?ds=sidebyside diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index f11ebb2af6..b1da8c92df 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -52,7 +52,7 @@ public: }; WX_DECLARE_OBJARRAY(wxHtmlTextPiece, wxHtmlTextPieces); -WX_DEFINE_OBJARRAY(wxHtmlTextPieces); +WX_DEFINE_OBJARRAY(wxHtmlTextPieces) class wxHtmlParserState { @@ -491,7 +491,8 @@ wxString wxHtmlEntitiesParser::Parse(const wxString& input) { if (c - last > 0) output.append(last, c - last); - if (++c == wxT('\0')) break; + if ( *++c == wxT('\0') ) + break; wxString entity; const wxChar *ent_s = c; @@ -833,11 +834,24 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) while (substitutions[substitutions_cnt].code != 0) substitutions_cnt++; - wxHtmlEntityInfo *info; + wxHtmlEntityInfo *info = NULL; +#ifdef __WXWINCE__ + // bsearch crashes under WinCE for some reason + size_t i; + for (i = 0; i < substitutions_cnt; i++) + { + if (entity == substitutions[i].name) + { + info = & substitutions[i]; + break; + } + } +#else info = (wxHtmlEntityInfo*) bsearch(entity.c_str(), substitutions, substitutions_cnt, sizeof(wxHtmlEntityInfo), wxHtmlEntityCompare); +#endif if (info) code = info->code; }