From 805fb726ccd846c4287d5b19be6351eae38b7583 Mon Sep 17 00:00:00 2001 From: "ulukyn@gmail.com" Date: Tue, 30 Jan 2018 16:26:26 +0100 Subject: [PATCH] Added: Add new html properties of group_html --HG-- branch : compatibility-develop --- code/nel/include/nel/gui/group_html.h | 5 +++++ code/nel/src/gui/group_html.cpp | 6 ++++++ code/nel/src/gui/group_html_parser.cpp | 2 ++ 3 files changed, 13 insertions(+) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 8d3478579..f3418ff24 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -244,6 +244,8 @@ namespace NLGUI std::string getURL() const { return _URL; } void setURL(const std::string &url); + std::string getHTML() const { return _DocumentHtml; } + void setHTML(const std::string &html); int luaBrowse(CLuaState &ls); int luaRefresh(CLuaState &ls); @@ -270,6 +272,7 @@ namespace NLGUI REFLECT_LUA_METHOD("parseHtml", luaParseHtml) REFLECT_LUA_METHOD("renderHtml", luaRenderHtml) REFLECT_STRING("url", getURL, setURL) + REFLECT_STRING("html", getHTML, setHTML) REFLECT_FLOAT("timeout", getTimeout, setTimeout) REFLECT_EXPORT_END @@ -378,6 +381,8 @@ namespace NLGUI // Current URL std::string _DocumentUrl; std::string _DocumentDomain; + std::string _DocumentHtml; // not updated only set by first render + // Valid base href was found bool _IgnoreBaseUrlTag; // Fragment from loading url diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 7853ada77..35cdf2956 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -6000,6 +6000,12 @@ namespace NLGUI browse(url.c_str()); } + void CGroupHTML::setHTML(const std::string &html) + { + renderHtmlString(html); + } + + // *************************************************************************** inline bool isDigit(ucchar c, uint base = 16) { diff --git a/code/nel/src/gui/group_html_parser.cpp b/code/nel/src/gui/group_html_parser.cpp index b2a61c4f9..855e1fec8 100644 --- a/code/nel/src/gui/group_html_parser.cpp +++ b/code/nel/src/gui/group_html_parser.cpp @@ -335,6 +335,8 @@ namespace NLGUI } htmlFreeParserCtxt(parser); + if (success) + _DocumentHtml = htmlString; return success; }