]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmlpars.cpp
Enable the correct code making sure that subwindows will always receive a wxSizeEvent...
[wxWidgets.git] / src / html / htmlpars.cpp
index f89b6f579f561a08ac4d2449f5b71b550299e065..ba8154d00dad9e6ef9524808538304e30149abc8 100644 (file)
@@ -557,6 +557,9 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const
 {
     unsigned code = 0;
 
+    if (entity.empty())
+      return 0; // invalid entity reference
+
     if (entity[0] == wxT('#'))
     {
         // NB: parsed value is a number, so it's OK to use wx_str(), internal
@@ -564,13 +567,13 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const
         const wxStringCharType *ent_s = entity.wx_str();
         const wxStringCharType *format;
 
-        if (ent_s[1] == wxSTRING_TEXT('x') || ent_s[1] == wxSTRING_TEXT('X'))
+        if (ent_s[1] == wxS('x') || ent_s[1] == wxS('X'))
         {
-            format = wxSTRING_TEXT("%x");
+            format = wxS("%x");
             ent_s++;
         }
         else
-            format = wxSTRING_TEXT("%u");
+            format = wxS("%u");
         ent_s++;
 
         if (wxSscanf(ent_s, format, &code) != 1)
@@ -580,7 +583,7 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const
     {
         // store the literals in wx's internal representation (either char*
         // in UTF-8 or wchar_t*) for best performance:
-        #define ENTITY(name, code) { wxSTRING_TEXT(name), code }
+        #define ENTITY(name, code) { wxS(name), code }
 
         static wxHtmlEntityInfo substitutions[] = {
             ENTITY("AElig", 198),
@@ -843,9 +846,10 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const
             while (substitutions[substitutions_cnt].code != 0)
                 substitutions_cnt++;
 
-        wxHtmlEntityInfo *info = NULL;
+        wxHtmlEntityInfo *info;
 #ifdef __WXWINCE__
         // bsearch crashes under WinCE for some reason
+        info = NULL;
         size_t i;
         for (i = 0; i < substitutions_cnt; i++)
         {