summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-03-29 19:22:26 -0400
committerOz Linden <oz@lindenlab.com>2011-03-29 19:22:26 -0400
commitb595bbcf2af03b2a285c2df450379b670bddbfbc (patch)
tree121ab3e96f6e72d53c5a4f84d761f13e1996bbda /indra/llui
parentfbd241da54ad6017825b59c5b0c71086d8b8957a (diff)
parent7cb4f2d87dc8619d8ad86cb82f6687f1a9821a69 (diff)
merge changes for storm-1019
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llmenugl.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 32d7be377a..f0374de98f 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -1936,9 +1936,15 @@ bool LLMenuGL::scrollItems(EScrollingDirection direction)
{
item_list_t::reverse_iterator first_visible_item_iter = mItems.rend();
+ // Need to scroll through number of actual existing items in menu.
+ // Otherwise viewer will hang for a time needed to scroll U32_MAX
+ // times in std::advance(). STORM-659.
+ size_t nitems = mItems.size();
+ U32 scrollable_items = nitems < mMaxScrollableItems ? nitems : mMaxScrollableItems;
+
// Advance by mMaxScrollableItems back from the end of the list
// to make the last item visible.
- std::advance(first_visible_item_iter, mMaxScrollableItems);
+ std::advance(first_visible_item_iter, scrollable_items);
mFirstVisibleItem = *first_visible_item_iter;
break;
}