From 4b4c8c8e37239302d12d72a7aef94ed272d7ef3d Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 20 Jan 2019 04:37:53 -0500 Subject: [PATCH] Woops, each link needs its own style! Thanks for testing, Torric! --- indra/llui/lltexteditor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 9db58989c..7f2327294 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -4183,15 +4183,15 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s LL_RECORD_BLOCK_TIME(FTM_PARSE_HTML); S32 start=0,end=0; LLUrlMatch match; - LLStyleSP link_style(new LLStyle); - if (style) *link_style = *style; - link_style->setColor(mLinkColor ? *mLinkColor : LLUI::sConfigGroup->getColor4("HTMLLinkColor")); + const auto& link_color = mLinkColor ? *mLinkColor : LLUI::sConfigGroup->getColor4("HTMLLinkColor"); auto append_substr = [&](const size_t& pos, const size_t& count) { appendAndHighlightText(text.substr(pos, count), part, style); }; auto append_link = [&](const std::string& link) { + LLStyleSP link_style(style ? new LLStyle(*style) : new LLStyle); + link_style->setColor(link_color); link_style->setLinkHREF(match.getUrl()); appendAndHighlightText(link, part, link_style); };