diff options
author | richard <none@none> | 2010-02-01 12:39:59 -0800 |
---|---|---|
committer | richard <none@none> | 2010-02-01 12:39:59 -0800 |
commit | 45e700cb3ef9c56aaf373a8b4acafb4fc07a5972 (patch) | |
tree | 394d990d038387952d0668da989dd4d7da072c86 /indra/llui/lltexteditor.cpp | |
parent | c339017d2e156a68f1e300a7668f2a9f6e6141f7 (diff) | |
parent | f99a7b23ae0cee0d3e96b0b89d82e5c35bb07433 (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); } } } |