From fe476d4872121c48ebc69ba384573d75f139495f Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 18 Dec 2015 14:29:40 +0200 Subject: [PATCH] Added: html TH element --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 13 +++++++++++++ code/nel/src/gui/libwww.cpp | 2 ++ 2 files changed, 15 insertions(+) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index d464b5a0c..8d43dbc02 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -1783,11 +1783,21 @@ namespace NLGUI _TR.push_back(false); } break; + case HTML_TH: + // TH is similar to TD, just different font style case HTML_TD: { // Get cells parameters getCellsParameters (MY_HTML_TD, true); + if (element_number == HTML_TH) + { + _FontWeight.push_back(FONT_WEIGHT_BOLD); + // center if not specified otherwise. TD/TH present/value arrays have same indices + if (!(present[MY_HTML_TD_ALIGN] && value[MY_HTML_TD_ALIGN])) + _CellParams.back().Align = CGroupCell::Center; + } + CGroupTable *table = getTable(); if (table) { @@ -2124,6 +2134,9 @@ namespace NLGUI endParagraph(); // Add a cell break; + case HTML_TH: + popIfNotEmpty (_FontWeight); + // no break; case HTML_TD: popIfNotEmpty (_CellParams); if (!_Cells.empty()) diff --git a/code/nel/src/gui/libwww.cpp b/code/nel/src/gui/libwww.cpp index 62c46b83e..54e28abf0 100644 --- a/code/nel/src/gui/libwww.cpp +++ b/code/nel/src/gui/libwww.cpp @@ -481,6 +481,8 @@ namespace NLGUI HTML_DTD->tags[HTML_TR].number_of_attributes = sizeof(tr_attr) / sizeof(HTAttr) - 1; HTML_DTD->tags[HTML_TD].attributes = td_attr; HTML_DTD->tags[HTML_TD].number_of_attributes = sizeof(td_attr) / sizeof(HTAttr) - 1; + HTML_DTD->tags[HTML_TH].attributes = td_attr; + HTML_DTD->tags[HTML_TH].number_of_attributes = sizeof(td_attr) / sizeof(HTAttr) - 1; HTML_DTD->tags[HTML_IMG].attributes = img_attr; HTML_DTD->tags[HTML_IMG].number_of_attributes = sizeof(img_attr) / sizeof(HTAttr) - 1; HTML_DTD->tags[HTML_INPUT].attributes = input_attr;