diff options
author | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-07-02 15:23:05 +0300 |
---|---|---|
committer | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-07-02 15:23:05 +0300 |
commit | 0cf9168895b1d7b69e4a0307ade6cbc607f799f2 (patch) | |
tree | e7cf7707d1de279010bfa3a132830a8b2c57346c /indra/llui/lltextbase.cpp | |
parent | 57a211a2ac9414e0e47d20ba97d56b5a978ce76a (diff) |
EXT-5692 FIX Add callback to create widget segment with LLAvatarIconCtrl (or LLGroupIconCtrl) based on url match id.
reviewed by Richard Nelson at https://codereview.productengine.com/secondlife/r/610/
--HG--
branch : product-engine
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r-- | indra/llui/lltextbase.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 17e41d9e24..e2f1d44f3e 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -40,6 +40,7 @@ #include "llscrollcontainer.h" #include "llstl.h" #include "lltextparser.h" +#include "lltextutil.h" #include "lltooltip.h" #include "lluictrl.h" #include "llurlaction.h" @@ -1594,6 +1595,9 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para while ( LLUrlRegistry::instance().findUrl(text, match, boost::bind(&LLTextBase::replaceUrlLabel, this, _1, _2)) ) { + + LLTextUtil::processUrlMatch(&match,this); + start = match.getStart(); end = match.getEnd()+1; @@ -1618,22 +1622,6 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para std::string subtext=text.substr(0,start); appendAndHighlightText(subtext, part, style_params); } - - // output an optional icon before the Url - if (! match.getIcon().empty()) - { - LLUIImagePtr image = LLUI::getUIImage(match.getIcon()); - if (image) - { - LLStyle::Params icon; - icon.image = image; - // Text will be replaced during rendering with the icon, - // but string cannot be empty or the segment won't be - // added (or drawn). - appendImageSegment(icon); - } - } - // output the styled Url (unless we've been asked to suppress hyperlinking) if (match.isLinkDisabled()) { @@ -1715,7 +1703,14 @@ void LLTextBase::appendImageSegment(const LLStyle::Params& style_params) insertStringNoUndo(getLength(), utf8str_to_wstring(" "), &segments); } +void LLTextBase::appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo) +{ + segment_vec_t segments; + LLWString widget_wide_text = utf8str_to_wstring(text); + segments.push_back(new LLInlineViewSegment(params, getLength(), getLength() + widget_wide_text.size())); + insertStringNoUndo(getLength(), widget_wide_text, &segments); +} void LLTextBase::appendAndHighlightTextImpl(const std::string &new_text, S32 highlight_part, const LLStyle::Params& style_params) { |