]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmltag.cpp
relinquish the mouse capture when a dialog is about to be made modal to ensure that...
[wxWidgets.git] / src / html / htmltag.cpp
index bcf337bc3b7b1e32b43afd0e8f39ebd41d87e8cb..05b9c77a2539221f269cc60298ca156d72c171b9 100644 (file)
 
 #include "wx/html/htmltag.h"
 
-#ifndef WXPRECOMP
+#ifndef WX_PRECOMP
     #include "wx/colour.h"
+    #include "wx/wxcrtvararg.h"
 #endif
 
 #include "wx/html/htmlpars.h"
 #include <stdio.h> // for vsscanf
 #include <stdarg.h>
 
-
 //-----------------------------------------------------------------------------
 // wxHtmlTagsCache
 //-----------------------------------------------------------------------------
@@ -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:
@@ -402,7 +407,15 @@ wxString wxHtmlTag::GetParam(const wxString& par, bool with_commas) const
 }
 
 int wxHtmlTag::ScanParam(const wxString& par,
-                         const wxChar *format,
+                         const char *format,
+                         void *param) const
+{
+    wxString parval = GetParam(par);
+    return wxSscanf(parval, format, param);
+}
+
+int wxHtmlTag::ScanParam(const wxString& par,
+                         const wchar_t *format,
                          void *param) const
 {
     wxString parval = GetParam(par);