summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-07-08 14:32:45 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-07-08 14:32:45 +0300
commit222cd49ad556b883168b57c7f8839a4887864602 (patch)
tree39ff74fee67d6ba0f0f9524d910bb3d3ae1870b8 /indra/llui/lltextbase.cpp
parent510958f6c4f4f1c1377fec0e484d7ef4d1d95030 (diff)
parent8cda9a026691690fd7e4bb0013cbccc287ef96d5 (diff)
Merge from default branch
--HG-- branch : product-engine
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r--indra/llui/lltextbase.cpp27
1 files changed, 11 insertions, 16 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index ccd22ee050..223998569b 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"
@@ -1595,6 +1596,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;
@@ -1619,22 +1623,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())
{
@@ -1716,7 +1704,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)
{