Merge with develop

--HG--
branch : compatibility-develop
hg/compatibility-develop
Nimetu 9 years ago
commit 152200decc

@ -419,6 +419,15 @@ namespace NLGUI
return _UL.back(); return _UL.back();
} }
// DL list
std::vector<bool> _DL;
inline bool getDL() const
{
if (_DL.empty())
return false;
return _DL.back();
}
// A mode // A mode
std::vector<bool> _A; std::vector<bool> _A;
inline bool getA() const inline bool getA() const
@ -430,6 +439,7 @@ namespace NLGUI
// IL mode // IL mode
bool _LI; bool _LI;
bool _DT;
// Current text color // Current text color
std::vector<NLMISC::CRGBA> _TextColor; std::vector<NLMISC::CRGBA> _TextColor;
@ -457,6 +467,12 @@ namespace NLGUI
return TextFontSize; return TextFontSize;
return _FontSize.back(); return _FontSize.back();
} }
inline uint getFontSizeSmaller() const
{
if (getFontSize() < 5)
return 3;
return getFontSize()-2;
}
std::vector<uint> _FontWeight; std::vector<uint> _FontWeight;
inline uint getFontWeight() const inline uint getFontWeight() const

@ -53,6 +53,8 @@ using namespace NLMISC;
#define DEFAULT_RYZOM_CONNECTION_TIMEOUT (30.0) #define DEFAULT_RYZOM_CONNECTION_TIMEOUT (30.0)
// Allow up to 10 redirects, then give up // Allow up to 10 redirects, then give up
#define DEFAULT_RYZOM_REDIRECT_LIMIT (10) #define DEFAULT_RYZOM_REDIRECT_LIMIT (10)
//
#define FONT_WEIGHT_BOLD 700
namespace NLGUI namespace NLGUI
{ {
@ -1832,10 +1834,64 @@ namespace NLGUI
_FontStrikeThrough.push_back(style.StrikeThrough); _FontStrikeThrough.push_back(style.StrikeThrough);
} }
break; break;
case HTML_DEL:
_FontStrikeThrough.push_back(true);
break;
case HTML_U:
_FontUnderlined.push_back(true);
break;
case HTML_EM:
_FontOblique.push_back(true);
break;
case HTML_STRONG:
_FontWeight.push_back(FONT_WEIGHT_BOLD);
break;
case HTML_SMALL:
_FontSize.push_back(getFontSizeSmaller());
break;
case HTML_STYLE: case HTML_STYLE:
case HTML_SCRIPT:
_IgnoreText = true; _IgnoreText = true;
break; break;
case HTML_DL:
_DL.push_back(true);
endParagraph();
break;
case HTML_DT:
if (getDL())
{
newParagraph(0);
// see if this is the first <dt>, closing tag not required
if (!_DT)
{
_DT = true;
_FontWeight.push_back(FONT_WEIGHT_BOLD);
}
if (_DL.size() > 1)
{
uint indent = (_DL.size()-1) * ULIndent;
getParagraph()->setFirstViewIndent(indent);
}
}
break;
case HTML_DD:
if (getDL())
{
newParagraph(0);
// if there was no closing tag for <dt>, then remove <dt> style
if (_DT)
{
_DT = false;
popIfNotEmpty (_FontWeight);
}
uint indent = _DL.size()*ULIndent;
getParagraph()->setFirstViewIndent(indent);
}
break;
} }
} }
} }
@ -1965,6 +2021,30 @@ namespace NLGUI
popIfNotEmpty (_UL); popIfNotEmpty (_UL);
} }
break; break;
case HTML_DL:
if (getDL())
{
endParagraph();
popIfNotEmpty (_DL);
if (_DT) {
_DT = false;
popIfNotEmpty (_FontWeight);
}
}
break;
case HTML_DT:
if (getDL())
{
if (_DT)
{
_DT = false;
popIfNotEmpty (_FontWeight);
}
}
break;
case HTML_DD:
// style not changed
break;
case HTML_SPAN: case HTML_SPAN:
popIfNotEmpty (_FontSize); popIfNotEmpty (_FontSize);
popIfNotEmpty (_FontWeight); popIfNotEmpty (_FontWeight);
@ -1973,7 +2053,23 @@ namespace NLGUI
popIfNotEmpty (_FontUnderlined); popIfNotEmpty (_FontUnderlined);
popIfNotEmpty (_FontStrikeThrough); popIfNotEmpty (_FontStrikeThrough);
break; break;
case HTML_DEL:
popIfNotEmpty (_FontStrikeThrough);
break;
case HTML_U:
popIfNotEmpty (_FontUnderlined);
break;
case HTML_EM:
popIfNotEmpty (_FontOblique);
break;
case HTML_STRONG:
popIfNotEmpty (_FontWeight);
break;
case HTML_SMALL:
popIfNotEmpty (_FontSize);
break;
case HTML_STYLE: case HTML_STYLE:
case HTML_SCRIPT:
_IgnoreText = false; _IgnoreText = false;
break; break;
case HTML_OBJECT: case HTML_OBJECT:
@ -2058,6 +2154,7 @@ namespace NLGUI
_CurrentViewImage = NULL; _CurrentViewImage = NULL;
_Indent = 0; _Indent = 0;
_LI = false; _LI = false;
_DT = false;
_SelectOption = false; _SelectOption = false;
_GroupListAdaptor = NULL; _GroupListAdaptor = NULL;
_UrlFragment.clear(); _UrlFragment.clear();
@ -3371,7 +3468,7 @@ namespace NLGUI
// Text added ? // Text added ?
bool added = false; bool added = false;
bool embolden = getFontWeight() >= 700; bool embolden = getFontWeight() >= FONT_WEIGHT_BOLD;
// Number of child in this paragraph // Number of child in this paragraph
if (_CurrentViewLink) if (_CurrentViewLink)
@ -3732,7 +3829,9 @@ namespace NLGUI
_FontStrikeThrough.clear(); _FontStrikeThrough.clear();
_Indent = 0; _Indent = 0;
_LI = false; _LI = false;
_DT = false;
_UL.clear(); _UL.clear();
_DL.clear();
_A.clear(); _A.clear();
_Link.clear(); _Link.clear();
_LinkTitle.clear(); _LinkTitle.clear();

Loading…
Cancel
Save