X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5526e819eca4465ed5520d49bccfebc6a28045e0..d80d1aba10c8c4e3ea9eb3587eb861363297221d:/src/html/mod_fonts.cpp diff --git a/src/html/mod_fonts.cpp b/src/html/mod_fonts.cpp index 45c723c1fb..006fc4865e 100644 --- a/src/html/mod_fonts.cpp +++ b/src/html/mod_fonts.cpp @@ -6,10 +6,23 @@ // 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 @@ -20,22 +33,25 @@ TAG_HANDLER_BEGIN(FONT, "FONT") TAG_HANDLER_PROC(tag) { - unsigned long tmp; wxColour oldclr = m_WParser -> GetActualColor(); int oldsize = m_WParser -> GetFontSize(); if (tag.HasParam("COLOR")) { + unsigned long tmp = 0; wxColour clr; - tag.ScanParam("COLOR", "#%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("COLOR", "#%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("SIZE")) { - tag.ScanParam("SIZE", "%li", &tmp); - m_WParser -> SetFontSize(tmp); - m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont())); + long tmp = 0; + if (tag.ScanParam("SIZE", "%li", &tmp) == 1) { + m_WParser -> SetFontSize(oldsize+tmp); + m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont())); + } } ParseInner(tag); @@ -172,4 +188,4 @@ TAGS_MODULE_BEGIN(Fonts) TAGS_MODULE_END(Fonts) -#endif \ No newline at end of file +#endif