X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5526e819eca4465ed5520d49bccfebc6a28045e0..a0378c28b877a68d8ef9991ce4b1433b2560d928:/src/html/mod_layout.cpp diff --git a/src/html/mod_layout.cpp b/src/html/mod_layout.cpp index 42b1de108c..1913589b1a 100644 --- a/src/html/mod_layout.cpp +++ b/src/html/mod_layout.cpp @@ -5,9 +5,21 @@ // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// +#ifdef __GNUG__ +#pragma implementation +#endif + +#include -#include "wx/defs.h" #if wxUSE_HTML +#ifdef __BORDLANDC__ +#pragma hdrstop +#endif + +#ifndef WXPRECOMP +#include +#endif + #include #include @@ -153,24 +165,27 @@ TAG_HANDLER_BEGIN(BODY, "BODY") 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; }