]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/m_layout.cpp
Applied updated patch [ 731719 ] Owner draw font leak/overuse
[wxWidgets.git] / src / html / m_layout.cpp
index edb2bd28f493660b4bd85649a8a91d9ca801cd15..e042da6e6a584bb9747eb548a5434151019b7200 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "wx/defs.h"
 #if wxUSE_HTML && wxUSE_STREAMS
-#ifdef __BORDLANDC__
+#ifdef __BORLANDC__
 #pragma hdrstop
 #endif
 
@@ -154,11 +154,9 @@ TAG_HANDLER_BEGIN(TITLE, "TITLE")
             wxHtmlWindow *wfr = (wxHtmlWindow*)(m_WParser->GetWindow());
             if (wfr)
             {
-                wxString title = "";
-                wxString *src = m_WParser->GetSource();
-
-                for (int i = tag.GetBeginPos(); i < tag.GetEndPos1(); i++) title += (*src)[(unsigned int) i];
-                wfr->OnSetTitle(title);
+                const wxString& src = *m_WParser->GetSource();
+                wfr->OnSetTitle(src.Mid(tag.GetBeginPos(), 
+                                        tag.GetEndPos1()-tag.GetBeginPos()));
             }
         }
         return TRUE;
@@ -226,6 +224,14 @@ TAG_HANDLER_END(BLOCKQUOTE)
 
 
 
+// Tag handler for tags that we have to ignore, otherwise non-text data
+// would show up as text:
+TAG_HANDLER_BEGIN(DoNothing, "SCRIPT")
+    TAG_HANDLER_PROC(tag)
+    {
+        return true;
+    }
+TAG_HANDLER_END(DoNothing)
 
 
 
@@ -238,6 +244,7 @@ TAGS_MODULE_BEGIN(Layout)
     TAGS_MODULE_ADD(TITLE)
     TAGS_MODULE_ADD(BODY)
     TAGS_MODULE_ADD(BLOCKQUOTE)
+    TAGS_MODULE_ADD(DoNothing)
 
 TAGS_MODULE_END(Layout)