summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-09-06 14:43:05 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-09-06 14:43:05 -0400
commit0a3e5074bbacdd9184311bd99a74913d1ce0423c (patch)
treecf1e921b12bcb46c8e372312e1d8bb44ecebd3cd
parent8de8daca601dc85e2b73687856f0a321016b4463 (diff)
Allow LLMenuGL::insert() to append as well as inserting.
Appending is effected by passing position == getItemCount(). Until now, insert() disallowed that value, so you could insert before the last existing entry but not after it.
-rw-r--r--indra/llui/llmenugl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 69ffa9a94f..cc770ca90a 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -2625,7 +2625,9 @@ void LLMenuGL::insert( S32 position, LLView * ctrl, bool arrange /*= true*/ )
{
LLMenuItemGL * item = dynamic_cast<LLMenuItemGL *>(ctrl);
- if (NULL == item || position < 0 || position >= mItems.size())
+ // If position == size(), std::advance() will return end() -- which is
+ // okay, because insert(end()) is the same as append().
+ if (NULL == item || position < 0 || position > mItems.size())
{
return;
}