diff options
author | Mike Antipov <mantipov@productengine.com> | 2010-04-26 17:19:43 +0300 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2010-04-26 17:19:43 +0300 |
commit | a00712e95133001b29fb15b15ccb6e66f2ec075b (patch) | |
tree | 6ba81a60576c425769a3a94a74bdaa52678462ce /indra/llui/llflatlistview.cpp | |
parent | d0204a2b149462371ee20725067e43b018c485bb (diff) |
Fixed major bug EXT-6092 [crashhunters] Crash in LLFlatListView::selectItemPair
Reason:
A) incorrect UP arrow handling in accordion control: invisible accordion tab was selected to handle selection.
B) invalid std::map item (in empty map) was used to make selection in Flat List
Fix: added checks against empty map before use front/back item pair before selecting first/last items.
Also updated processing of the UP key in accordion control to not select invisible accordion tab.
Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/318/
--HG--
branch : product-engine
Diffstat (limited to 'indra/llui/llflatlistview.cpp')
-rw-r--r-- | indra/llui/llflatlistview.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index 990bf5cd22..e0b2244654 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -744,12 +744,18 @@ LLRect LLFlatListView::getLastSelectedItemRect() void LLFlatListView::selectFirstItem () { + // No items - no actions! + if (mItemPairs.empty()) return; + selectItemPair(mItemPairs.front(), true); ensureSelectedVisible(); } void LLFlatListView::selectLastItem () { + // No items - no actions! + if (mItemPairs.empty()) return; + selectItemPair(mItemPairs.back(), true); ensureSelectedVisible(); } |