From eb39d5d71b3fb7851c7741e490ab22020fe55070 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 28 Oct 2012 20:12:56 +0100 Subject: [PATCH] Added option to not show icon for SLURL links & moved left-side icon directly in front of the link in contrast to pre-EXP-1953 --- indra/llui/lltextbase.cpp | 16 +++++++++------- indra/llui/lltextbase.h | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index d2f11173a4..59ad77fc6d 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -147,6 +147,7 @@ namespace LLInitParam { declare("left", LLTextBaseEnums::LEFT); declare("right", LLTextBaseEnums::RIGHT); + declare("none", LLTextBaseEnums::NONE); } } // Optional icon position @@ -2019,13 +2020,6 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para while ( LLUrlRegistry::instance().findUrl(text, match, boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3)) ) { - // Optional icon position - if (mIconPositioning == LLTextBaseEnums::LEFT) - { - LLTextUtil::processUrlMatch(&match,this); - } - // Optional icon position - start = match.getStart(); end = match.getEnd()+1; @@ -2047,6 +2041,14 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para std::string subtext=text.substr(0,start); appendAndHighlightText(subtext, part, style_params); } + + // Optional icon position + if (mIconPositioning == LLTextBaseEnums::LEFT) + { + LLTextUtil::processUrlMatch(&match,this); + } + // Optional icon position + // output the styled Url appendAndHighlightTextImpl(match.getLabel(), part, link_params, match.underlineOnHoverOnly()); diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 1bd005e70d..439bcc0d74 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -236,7 +236,8 @@ namespace LLTextBaseEnums enum EIconPositioning { LEFT, - RIGHT + RIGHT, + NONE }; }