diff options
author | Jonathan "Geenz" Goodman <geenz@lindenlab.com> | 2025-08-25 09:14:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-25 09:14:09 -0400 |
commit | 9f50a5b25bc7471fba5cdb19d6793f460422cbe5 (patch) | |
tree | b9ab1b401ebd556ed97580ab9f94cd8fb83d121a /indra/llui/lltextbase.cpp | |
parent | cefee59b0e5fff683a50fe61633a9c14493d7145 (diff) | |
parent | 2a3fa6964507f133a599649efe58e350efc43fdf (diff) |
Merge pull request #4603 from secondlife/release/2025.06
Update develop with latest 2025.06 changes.
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r-- | indra/llui/lltextbase.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index d5755ae4b6..ffaa09fd8c 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1069,6 +1069,14 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s S32 LLTextBase::removeStringNoUndo(S32 pos, S32 length) { + S32 text_length = (S32)getLength(); + if (pos >= text_length || pos < 0) + { + return 0; // nothing to remove + } + // Clamp length to not go past the end of the text + length = std::min(length, text_length - pos); + beforeValueChange(); segment_set_t::iterator seg_iter = getSegIterContaining(pos); while(seg_iter != mSegments.end()) |