summaryrefslogtreecommitdiff
path: root/indra/llui/llmenugl.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-03-28 11:32:05 -0400
committerOz Linden <oz@lindenlab.com>2011-03-28 11:32:05 -0400
commit3d5a8cc2e3becd92c83fb87d65dfbe802738edde (patch)
tree62f8c2b244d5f3779145d53288895dd6f3af1ccf /indra/llui/llmenugl.cpp
parent68e2813b41d676fd6ab5d79e934ac6ff75fb8a5b (diff)
parent7617868658fec7fa70730a3448f8cfbe7661dd8e (diff)
merge late fix for SOCIAL-778 into 2.6.1 for release
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;
}