summaryrefslogtreecommitdiff
path: root/indra/llui/llmenugl.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2011-03-21 10:38:39 -0400
committerLoren Shih <seraph@lindenlab.com>2011-03-21 10:38:39 -0400
commitbe553242ef706e33260f3f9e62d02f4720f00473 (patch)
tree553a150a63cd8105f8860780ef7d02f12a69eb23 /indra/llui/llmenugl.cpp
parent9c1c791b29cb5087ebff142d4ad7a55b65be0ad0 (diff)
parentdf63c6931e81c034887611711095e3134b9a7318 (diff)
Automated merge up from viewer-development into mesh-development
Diffstat (limited to 'indra/llui/llmenugl.cpp')
-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;
}