diff options
author | richard <none@none> | 2010-02-01 13:51:37 -0800 |
---|---|---|
committer | richard <none@none> | 2010-02-01 13:51:37 -0800 |
commit | 7855785caa94b3c14b1bd52d1d1daf780d9a100b (patch) | |
tree | 5af3b6371ab92b36b3611de2c19da82cb4b2ac30 /indra/llui/lltexteditor.cpp | |
parent | 5fe9863ff51d52df4a9ab6f6281fd16e6ef029db (diff) | |
parent | 08adb4cfed36b6eda2446c3454637f3ac0a644e6 (diff) |
merge
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rw-r--r-- | indra/llui/lltexteditor.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 06ba0d80e9..e76fee9f17 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2404,7 +2404,7 @@ void LLTextEditor::replaceUrlLabel(const std::string &url, for (it = mSegments.begin(); it != mSegments.end(); ++it) { LLTextSegment *seg = *it; - const LLStyleSP style = seg->getStyle(); + LLStyleConstSP style = seg->getStyle(); // update segment start/end length in case we replaced text earlier S32 seg_length = seg->getEnd() - seg->getStart(); @@ -2573,13 +2573,16 @@ void LLTextEditor::updateLinkSegments() // if the link's label (what the user can edit) is a valid Url, // then update the link's HREF to be the same as the label text. // This lets users edit Urls in-place. - LLStyleSP style = static_cast<LLStyleSP>(segment->getStyle()); + LLStyleConstSP style = segment->getStyle(); + LLStyle* new_style = new LLStyle(*style); LLWString url_label = wtext.substr(segment->getStart(), segment->getEnd()-segment->getStart()); if (LLUrlRegistry::instance().hasUrl(url_label)) { std::string new_url = wstring_to_utf8str(url_label); LLStringUtil::trim(new_url); - style->setLinkHREF(new_url); + new_style->setLinkHREF(new_url); + LLStyleConstSP sp(new_style); + segment->setStyle(sp); } } } |