X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/33ac7e6f01acbac1cff0ad400d8ea7f0bfd0a62f..98ec9dbebc5584ba1b903d314b25e8c562891483:/src/html/m_layout.cpp diff --git a/src/html/m_layout.cpp b/src/html/m_layout.cpp index e3f8ec8c3f..c8fe7096be 100644 --- a/src/html/m_layout.cpp +++ b/src/html/m_layout.cpp @@ -174,43 +174,23 @@ TAG_HANDLER_BEGIN(BODY, "BODY") TAG_HANDLER_PROC(tag) { - unsigned long tmp; wxColour clr; - if (tag.HasParam(wxT("TEXT"))) + if (tag.GetParamAsColour(wxT("TEXT"), &clr)) { - if (tag.ScanParam(wxT("TEXT"), wxT("#%lX"), &tmp) == 1) - { - clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16), - (unsigned char)((tmp & 0x00FF00) >> 8), - (unsigned char)(tmp & 0x0000FF)); - m_WParser->SetActualColor(clr); - m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(clr)); - } - } - - if (tag.HasParam(wxT("LINK"))) - { - if (tag.ScanParam(wxT("LINK"), wxT("#%lX"), &tmp) == 1) - { - clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16), - (unsigned char)((tmp & 0x00FF00) >> 8), - (unsigned char)(tmp & 0x0000FF)); - m_WParser->SetLinkColor(clr); - } + m_WParser->SetActualColor(clr); + m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(clr)); } - if (tag.HasParam(wxT("BGCOLOR"))) + if (tag.GetParamAsColour(wxT("LINK"), &clr)) + m_WParser->SetLinkColor(clr); + + if (tag.GetParamAsColour(wxT("BGCOLOR"), &clr)) { - if (tag.ScanParam(wxT("BGCOLOR"), wxT("#%lX"), &tmp) == 1) - { - clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16), - (unsigned char)((tmp & 0x00FF00) >> 8), - (unsigned char)(tmp & 0x0000FF)); - m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(clr, wxHTML_CLR_BACKGROUND)); - if (m_WParser->GetWindow() != NULL) - m_WParser->GetWindow()->SetBackgroundColour(clr); - } + m_WParser->GetContainer()->InsertCell( + new wxHtmlColourCell(clr, wxHTML_CLR_BACKGROUND)); + if (m_WParser->GetWindow() != NULL) + m_WParser->GetWindow()->SetBackgroundColour(clr); } return FALSE; }