From 4da13aa473caa2772ec345d0bc428d4134450f04 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Tue, 5 Jan 2016 23:23:19 +0200 Subject: [PATCH] Fixed: DL list top margin --- code/nel/src/gui/group_html.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 1e802d9f2..807558f43 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -1924,7 +1924,7 @@ namespace NLGUI else _UL.push_back(HTMLOListElement(1, "square")); // if LI is already present - _LI = _UL.size() > 1; + _LI = _UL.size() > 1 || getDL(); _Indent += ULIndent; endParagraph(); break; @@ -1986,19 +1986,28 @@ namespace NLGUI break; case HTML_DL: _DL.push_back(true); + _LI = _DL.size() > 1 || !_UL.empty(); endParagraph(); break; case HTML_DT: if (getDL()) { - newParagraph(0); - // see if this is the first
, closing tag not required if (!_DT) { _DT = true; _FontWeight.push_back(FONT_WEIGHT_BOLD); } + + if (!_LI) + { + _LI = true; + newParagraph(ULBeginSpace); + } + else + { + newParagraph(LIBeginSpace); + } } break; case HTML_DD: @@ -2012,7 +2021,15 @@ namespace NLGUI } _Indent += ULIndent; - newParagraph(0); + if (!_LI) + { + _LI = true; + newParagraph(ULBeginSpace); + } + else + { + newParagraph(LIBeginSpace); + } } break; case HTML_OL: @@ -2027,7 +2044,7 @@ namespace NLGUI _UL.push_back(HTMLOListElement(start, type)); // if LI is already present - _LI = _UL.size() > 1; + _LI = _UL.size() > 1 || getDL(); _Indent += ULIndent; endParagraph(); }