diff options
Diffstat (limited to 'indra/llui/llaccordionctrl.cpp')
-rw-r--r-- | indra/llui/llaccordionctrl.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 5f866c49e6..6bf1347514 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -66,6 +66,7 @@ LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) , mAutoScrolling( false ) , mAutoScrollRate( 0.f ) , mSelectedTab( NULL ) + , mTabComparator( NULL ) , mNoVisibleTabsHelpText(NULL) { initNoTabsWidget(params.empty_accordion_text); @@ -799,6 +800,18 @@ void LLAccordionCtrl::reset () mScrollbar->setDocPos(0); } +void LLAccordionCtrl::sort() +{ + if (!mTabComparator) + { + llwarns << "No comparator specified for sorting accordion tabs." << llendl; + return; + } + + std::sort(mAccordionTabs.begin(), mAccordionTabs.end(), LLComparatorAdaptor(*mTabComparator)); + arrange(); +} + void LLAccordionCtrl::setFilterSubString(const std::string& filter_string) { LLStringUtil::format_map_t args; |