summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2025-08-25 09:14:09 -0400
committerGitHub <noreply@github.com>2025-08-25 09:14:09 -0400
commit9f50a5b25bc7471fba5cdb19d6793f460422cbe5 (patch)
treeb9ab1b401ebd556ed97580ab9f94cd8fb83d121a /indra/llui
parentcefee59b0e5fff683a50fe61633a9c14493d7145 (diff)
parent2a3fa6964507f133a599649efe58e350efc43fdf (diff)
Merge pull request #4603 from secondlife/release/2025.06
Update develop with latest 2025.06 changes.
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llflatlistview.cpp2
-rw-r--r--indra/llui/lltextbase.cpp8
2 files changed, 9 insertions, 1 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index 5be20bd314..dfe0a71b74 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -69,7 +69,7 @@ const LLRect& LLFlatListView::getItemsRect() const
bool LLFlatListView::addItem(LLPanel * item, const LLSD& value /*= LLUUID::null*/, EAddPosition pos /*= ADD_BOTTOM*/,bool rearrange /*= true*/)
{
if (!item) return false;
- if (value.isUndefined()) return false;
+ if (value.isUndefined()) return false; // item stays an orphan?!!!
//force uniqueness of items, easiest check but unreliable
if (item->getParent() == mItemsPanel) return false;
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())