diff options
| author | Callum Prentice <callum@lindenlab.com> | 2025-08-29 14:51:08 -0700 |
|---|---|---|
| committer | Callum Prentice <callum@lindenlab.com> | 2025-08-29 14:51:08 -0700 |
| commit | db69b09d82e29ea98c216d84d394f602a72b8f93 (patch) | |
| tree | 7cb1481c15eb8f9dfbc12d6ed1424131c98264fa /indra/llui/lltextbase.cpp | |
| parent | 87ec630053aadcb5b5f6104f7d083acf4609e2e9 (diff) | |
| parent | e77eb6b5316ce68fbc8bc03c4b06fe0f13b3443d (diff) | |
Merge branch 'develop' into callum/viewer-cef-2025-08
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()) |
