From a00712e95133001b29fb15b15ccb6e66f2ec075b Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 26 Apr 2010 17:19:43 +0300 Subject: 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 --- indra/llui/llaccordionctrl.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'indra/llui/llaccordionctrl.cpp') diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 136fd2a9ac..dca43c5784 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -668,15 +668,23 @@ S32 LLAccordionCtrl::notifyParent(const LLSD& info) LLAccordionCtrlTab* accordion_tab = dynamic_cast(mAccordionTabs[i]); if(accordion_tab->hasFocus() && i>0) { + bool prev_visible_tab_found = false; while(i>0) { if(mAccordionTabs[--i]->getVisible()) + { + prev_visible_tab_found = true; break; + } } - - accordion_tab = dynamic_cast(mAccordionTabs[i]); - accordion_tab->notify(LLSD().with("action","select_last")); - return 1; + + if (prev_visible_tab_found) + { + accordion_tab = dynamic_cast(mAccordionTabs[i]); + accordion_tab->notify(LLSD().with("action","select_last")); + return 1; + } + break; } } return 0; -- cgit v1.2.3 From fbfc85176670f3f948e6e2f00c8d8e37c96d5299 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Mon, 26 Apr 2010 18:56:28 +0300 Subject: (EXT-6722) Create modified inventory view for "my outfits" tab in top-level appearance sidebar (tier 1) llui: - Setting container panel for accordion tab control to dynamically add tabs to accordions. - Added method to dynamically remove accordion tabs. - Added LLIconCtrl image setter. newview: - Class LLOutfitsList - a list of agents's outfits from "My Outfits" inventory category which represents each outfit by an accordion tab with a list of items inside it. - Class LLWearableItemsList - a list of wearable items used in each accordion tab of "My Outfits" tab. - Class LLInventoryItemsList - a base class for LLWearableItemsList that represents inventory items by panels in LLFlatListView. - Class LLPanelInventoryItem - inventory item representation for a flat list. Item icon is set according to item type. - Class LLInventoryCategoriesObserver - an observer used in LLOutfitsList for monitoring changes to "My Outfits" inventory category and updating outfits accordion tabs and list of items for each outfit. Reviewed by Mike Antipov https://codereview.productengine.com/secondlife/r/285/ --HG-- branch : product-engine --- indra/llui/llaccordionctrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/llaccordionctrl.cpp') diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index dca43c5784..5d1d57cbb2 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -329,7 +329,7 @@ void LLAccordionCtrl::addCollapsibleCtrl(LLView* view) LLAccordionCtrlTab* accordion_tab = dynamic_cast(view); if(!accordion_tab) return; - if(std::find(getChildList()->begin(),getChildList()->end(),accordion_tab) == getChildList()->end()) + if(std::find(beginChild(), endChild(), accordion_tab) == endChild()) addChild(accordion_tab); mAccordionTabs.push_back(accordion_tab); @@ -343,7 +343,7 @@ void LLAccordionCtrl::removeCollapsibleCtrl(LLView* view) if(!accordion_tab) return; - if(std::find(getChildList()->begin(),getChildList()->end(),accordion_tab) != getChildList()->end()) + if(std::find(beginChild(), endChild(), accordion_tab) != endChild()) removeChild(accordion_tab); for (std::vector::iterator iter = mAccordionTabs.begin(); -- cgit v1.2.3