summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul ProductEngine <pguslisty@productengine.com>2011-03-11 20:33:06 +0200
committerPaul ProductEngine <pguslisty@productengine.com>2011-03-11 20:33:06 +0200
commit2453ccbd3ee10a4f845e98fb51aac6c1e4bca5a5 (patch)
tree68ce2bb114f0cb7a1509010b8db78abafce4c3a5
parent1426765e82549ec9d17a0f90d902f25c0e785bbd (diff)
STORM-659 FIXED Viewer hangs when navigate in the Back/Fwd Teleport history by keyboard
Reason: If user didn't set number of max scrollable items (msi) then msi = U32_MAX Solution: If user didn't set number of msi then number of scrollable items = number of items in menu.
-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;
}