// Copyright: (c) 1999 Vaclav Slavik
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include <wx/wxprec.h>
-#include "wx/defs.h"
#if wxUSE_HTML
+#ifdef __BORDLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WXPRECOMP
+#include <wx/wx.h>
+#endif
+
#include <wx/html/forcelink.h>
#include <wx/html/mod_templ.h>
wxColour clr;
if (tag.HasParam("TEXT")) {
- tag.ScanParam("TEXT", "#%lX", &tmp);
- clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
- m_WParser -> SetActualColor(clr);
- m_WParser -> GetContainer() -> InsertCell(new wxHtmlColourCell(clr));
- }
+ if (tag.ScanParam("TEXT", "#%lX", &tmp) == 1) {
+ clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
+ m_WParser -> SetActualColor(clr);
+ m_WParser -> GetContainer() -> InsertCell(new wxHtmlColourCell(clr));
+ }
+ }
if (tag.HasParam("LINK")) {
- tag.ScanParam("LINK", "#%lX", &tmp);
- clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
- m_WParser -> SetLinkColor(clr);
+ if (tag.ScanParam("LINK", "#%lX", &tmp) == 1) {
+ clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
+ m_WParser -> SetLinkColor(clr);
+ }
}
if (tag.HasParam("BGCOLOR")) {
- tag.ScanParam("BGCOLOR", "#%lX", &tmp);
- clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
- m_WParser -> GetContainer() -> InsertCell(new wxHtmlColourCell(clr, HTML_CLR_BACKGROUND));
- if (m_WParser -> GetWindow() != NULL)
- m_WParser -> GetWindow() -> SetBackgroundColour(clr);
+ if (tag.ScanParam("BGCOLOR", "#%lX", &tmp) == 1) {
+ clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
+ m_WParser -> GetContainer() -> InsertCell(new wxHtmlColourCell(clr, HTML_CLR_BACKGROUND));
+ if (m_WParser -> GetWindow() != NULL)
+ m_WParser -> GetWindow() -> SetBackgroundColour(clr);
+ }
}
return FALSE;
}