fixed interpretation of <font size>: 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
This commit is contained in:
Václav Slavík
1999-12-23 21:12:33 +00:00
parent 846914d18d
commit 2463329cd3

View File

@@ -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);
}