diff --git a/.gitignore b/.gitignore index 82fddbca0..dfc254b44 100644 --- a/.gitignore +++ b/.gitignore @@ -163,6 +163,7 @@ build-2010/* build/* install/* build_* +install_* nel/tools/build_gamedata/configuration/buildsite.py # Linux nel compile diff --git a/nel/include/nel/gui/html_element.h b/nel/include/nel/gui/html_element.h index cc59d2126..034bbccbf 100644 --- a/nel/include/nel/gui/html_element.h +++ b/nel/include/nel/gui/html_element.h @@ -76,16 +76,16 @@ namespace NLGUI void reindexChilds(); // escape text tag or attribute value - std::string htmlEscape(std::string val, bool isAttribute = false) const; + std::string htmlEscape(const std::string &val) const; // serialize element attributes as string - std::string serializeAttributes() const; + std::string serializeAttributes(bool escape = true) const; // serialize child elements as html string - std::string serializeChilds() const; + std::string serializeChilds(bool escape = true) const; // serialize itself and children as html string - std::string serialize() const; + std::string serialize(bool escape = true) const; // debug std::string toString(bool tree = false, uint depth = 0) const; diff --git a/nel/src/gui/css_background_renderer.cpp b/nel/src/gui/css_background_renderer.cpp index 2c755ad80..16553f3f3 100644 --- a/nel/src/gui/css_background_renderer.cpp +++ b/nel/src/gui/css_background_renderer.cpp @@ -140,13 +140,6 @@ namespace NLGUI // flush draw cache to ensure correct draw order rVR.flush(); - sint32 clipX, clipY, clipW, clipH; - if (m_Viewport) - { - rVR.getClipWindow(clipX, clipY, clipW, clipH); - rVR.setClipWindow(m_Viewport->getXReal(), m_Viewport->getYReal(), m_Viewport->getWReal(), m_Viewport->getHReal()); - } - // TODO: no need for widget manager, if global color is set from parent CRGBA globalColor; if (m_ModulateGlobalColor) @@ -166,9 +159,6 @@ namespace NLGUI // flush draw cache to ensure correct draw order rVR.flush(); - - if (m_Viewport) - rVR.setClipWindow(clipX, clipY, clipW, clipH); } // ---------------------------------------------------------------------------- diff --git a/nel/src/gui/group_html.cpp b/nel/src/gui/group_html.cpp index 5fec4f266..55aeaec82 100644 --- a/nel/src/gui/group_html.cpp +++ b/nel/src/gui/group_html.cpp @@ -6790,7 +6790,7 @@ namespace NLGUI _TextAreaTemplate = !templateName.empty() ? templateName : DefaultFormTextAreaGroup; - std::string content = strFindReplaceAll(elm.serializeChilds(), std::string("\r"), std::string("")); + std::string content = strFindReplaceAll(elm.serializeChilds(false), std::string("\r"), std::string("")); CInterfaceGroup *textArea = addTextArea (_TextAreaTemplate, _TextAreaName.c_str (), _TextAreaRow, _TextAreaCols, true, content, _TextAreaMaxLength); if (textArea) @@ -6823,7 +6823,7 @@ namespace NLGUI // if (!_ReadingHeadTag) return; // consume all child elements - _TitleString = strFindReplaceAll(elm.serializeChilds(), std::string("\t"), std::string(" ")); + _TitleString = strFindReplaceAll(elm.serializeChilds(false), std::string("\t"), std::string(" ")); _TitleString = strFindReplaceAll(_TitleString, std::string("\n"), std::string(" ")); setTitle(_TitleString); } diff --git a/nel/src/gui/html_element.cpp b/nel/src/gui/html_element.cpp index 8eb706cc9..f4e770a4a 100644 --- a/nel/src/gui/html_element.cpp +++ b/nel/src/gui/html_element.cpp @@ -142,30 +142,33 @@ namespace NLGUI } // *************************************************************************** - std::string CHtmlElement::htmlEscape(std::string val, bool isAttribute) const + std::string CHtmlElement::htmlEscape(const std::string &val) const { - static const std::string searchReplace[] = { - "&", "&", - "<", "<", - ">", ">", - "\xA0", " ", - }; - - for(uint i = 0; i < (sizeof(searchReplace) / sizeof(searchReplace[0])); i+=2) - val = strFindReplaceAll(val, searchReplace[i], searchReplace[i+1]); - - if (isAttribute) + if (val.find_first_of("\"'&<>\xA0") == std::string::npos) + return val; + + std::string ret; + // resize is quaranteed, make room for some free replacements + ret.reserve(val.size() + 24); + for(size_t pos = 0; pos != val.size(); pos++) { - static const std::string q = "\""; - static const std::string quot = """; - val = strFindReplaceAll(val, q, quot); + switch(val[pos]) + { + case '"': ret.append("""); break; + case '\'': ret.append("'"); break; + case '&': ret.append("&"); break; + case '<': ret.append("<"); break; + case '>': ret.append(">"); break; + case '\xA0': ret.append(" "); break; + default : ret.append(&val[pos],1); break; + } } - return val; + return ret; } // *************************************************************************** - std::string CHtmlElement::serializeAttributes() const + std::string CHtmlElement::serializeAttributes(bool escape) const { std::string result; for(std::map::const_iterator it = Attributes.begin(); it != Attributes.end(); ++it) @@ -179,30 +182,30 @@ namespace NLGUI { result += " "; } - result += htmlEscape(*it2, true); + result += (escape ? htmlEscape(*it2) : *it2); } result += "\""; } else { - result += " " + it->first + "=\"" + htmlEscape(it->second, true) + "\""; + result += " " + it->first + "=\"" + (escape ? htmlEscape(it->second) : it->second) + "\""; } } return result; } // *************************************************************************** - std::string CHtmlElement::serializeChilds() const + std::string CHtmlElement::serializeChilds(bool escape) const { std::string result; for(std::list::const_iterator it = Children.begin(); it != Children.end(); ++it) - result += it->serialize(); + result += it->serialize(escape); return result; } // *************************************************************************** - std::string CHtmlElement::serialize() const + std::string CHtmlElement::serialize(bool escape) const { if (Type == TEXT_NODE) { @@ -211,12 +214,14 @@ namespace NLGUI parent->ID == HTML_NOSCRIPT)) { return Value; - } else { + } else if (escape) { return htmlEscape(Value); + } else { + return Value; } } - std::string result = "<" + Value + serializeAttributes() + ">"; + std::string result = "<" + Value + serializeAttributes(escape) + ">"; if (ID == HTML_AREA || ID == HTML_BASE || ID == HTML_BR || ID == HTML_COL || ID == HTML_EMBED || ID == HTML_HR || @@ -231,7 +236,7 @@ namespace NLGUI result += "\n"; if (!Children.empty()) - result += serializeChilds(); + result += serializeChilds(escape); result += ""; diff --git a/ryzom/client/src/user_entity.cpp b/ryzom/client/src/user_entity.cpp index 375f521b3..ce0915acc 100644 --- a/ryzom/client/src/user_entity.cpp +++ b/ryzom/client/src/user_entity.cpp @@ -1404,18 +1404,6 @@ void CUserEntity::moveToCheckStartDist(CLFECOMMON::TCLEntityId slot, double dist // disable afk mode setAFK(false); - - // if sufficiently near, launch the action - CEntityCL *target = EntitiesMngr.entity(slot); - if(target) - { - CVectorD dir2targ = target->pos() - pos(); - dir2targ.z = 0.0; - if((dir2targ==CVectorD::Null) || (dir2targ.norm() < dist)) - { - moveToAction(target); - } - } } }// moveToCheckStartDist //