From 2463329cd36c305f4007445049a89439fb7e62a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 23 Dec 1999 21:12:33 +0000 Subject: [PATCH] fixed interpretation of : was always relative to current size, now conforms to HTML specs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/m_fonts.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/html/m_fonts.cpp b/src/html/m_fonts.cpp index aae04a9b50..6ad8550e1b 100644 --- a/src/html/m_fonts.cpp +++ b/src/html/m_fonts.cpp @@ -49,8 +49,12 @@ TAG_HANDLER_BEGIN(FONT, "FONT") if (tag.HasParam(wxT("SIZE"))) { long tmp = 0; + wxChar c = tag.GetParam(wxT("SIZE"))[0]; if (tag.ScanParam(wxT("SIZE"), wxT("%li"), &tmp) == 1) { - m_WParser -> SetFontSize(oldsize+tmp); + if (c == '+' || c == '-') + m_WParser -> SetFontSize(oldsize+tmp); + else + m_WParser -> SetFontSize(tmp); m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont())); } } @@ -176,20 +180,20 @@ TAG_HANDLER_BEGIN(Hx, "H1,H2,H3,H4,H5,H6") m_WParser -> SetFontFixed(FALSE); if (tag.GetName() == "H1") - m_WParser -> SetFontSize(+4); + m_WParser -> SetFontSize(7); else if (tag.GetName() == "H2") - m_WParser -> SetFontSize(+3); + m_WParser -> SetFontSize(6); else if (tag.GetName() == "H3") - m_WParser -> SetFontSize(+2); + m_WParser -> SetFontSize(5); else if (tag.GetName() == "H4") { - m_WParser -> SetFontSize(+2); + m_WParser -> SetFontSize(5); m_WParser -> SetFontItalic(TRUE); m_WParser -> SetFontBold(FALSE); } else if (tag.GetName() == "H5") - m_WParser -> SetFontSize(+1); + m_WParser -> SetFontSize(4); else if (tag.GetName() == "H6") { - m_WParser -> SetFontSize(+1); + m_WParser -> SetFontSize(4); m_WParser -> SetFontItalic(TRUE); m_WParser -> SetFontBold(FALSE); } -- 2.45.2