diff options
| author | richard <none@none> | 2010-01-22 16:51:13 -0800 |
|---|---|---|
| committer | richard <none@none> | 2010-01-22 16:51:13 -0800 |
| commit | 337716d946cf4ece8ba59cce82bd51b3c2148f75 (patch) | |
| tree | 3dee9d70847c017e00e0090692606058565bfdd3 /indra/llui/lltexteditor.cpp | |
| parent | 41f2b8e6017c4846430f501dc3d4877b505b9fbd (diff) | |
LLPointer cleanup and fix for EXT-4413
reviewed by Rick
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
| -rw-r--r-- | indra/llui/lltexteditor.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index f2c3879a6c..93ce7a4bea 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2390,7 +2390,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(); @@ -2559,13 +2559,15 @@ 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); + segment->setStyle(LLStyleConstSP(new_style)); } } } |
