summaryrefslogtreecommitdiff
path: root/indra/llui/llscrolllistctrl.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-01-10 23:51:52 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-01-10 23:51:52 +0200
commit469ce7f7f6828aa8ed8d45fdff82cb33c1ec655d (patch)
tree6ec74d5dbe9c278663a99212cddf808e87d4e6c6 /indra/llui/llscrolllistctrl.cpp
parent83b4ea59fc8793ccbfb6b40ffff111de14ebd4d3 (diff)
parentee2d618706a8803372b92dbe47a165c70be6cef9 (diff)
Merge branch 'DRTVWR-530-maint' into DRTVWR-553-maint-mix-JK
# Conflicts: # indra/newview/app_settings/key_bindings.xml # indra/newview/llappviewer.cpp # indra/newview/llkeyconflict.cpp
Diffstat (limited to 'indra/llui/llscrolllistctrl.cpp')
-rw-r--r--indra/llui/llscrolllistctrl.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index a63457bdea..cd87c44dc2 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -66,9 +66,10 @@ static LLDefaultChildRegistry::Register<LLScrollListCtrl> r("scroll_list");
// local structures & classes.
struct SortScrollListItem
{
- SortScrollListItem(const std::vector<std::pair<S32, BOOL> >& sort_orders,const LLScrollListCtrl::sort_signal_t* sort_signal)
+ SortScrollListItem(const std::vector<std::pair<S32, BOOL> >& sort_orders,const LLScrollListCtrl::sort_signal_t* sort_signal, bool alternate_sort)
: mSortOrders(sort_orders)
, mSortSignal(sort_signal)
+ , mAltSort(alternate_sort)
{}
bool operator()(const LLScrollListItem* i1, const LLScrollListItem* i2)
@@ -93,7 +94,14 @@ struct SortScrollListItem
}
else
{
- sort_result = order * LLStringUtil::compareDict(cell1->getValue().asString(), cell2->getValue().asString());
+ if (mAltSort && !cell1->getAltValue().asString().empty() && !cell2->getAltValue().asString().empty())
+ {
+ sort_result = order * LLStringUtil::compareDict(cell1->getAltValue().asString(), cell2->getAltValue().asString());
+ }
+ else
+ {
+ sort_result = order * LLStringUtil::compareDict(cell1->getValue().asString(), cell2->getValue().asString());
+ }
}
if (sort_result != 0)
{
@@ -109,6 +117,7 @@ struct SortScrollListItem
typedef std::vector<std::pair<S32, BOOL> > sort_order_t;
const LLScrollListCtrl::sort_signal_t* mSortSignal;
const sort_order_t& mSortOrders;
+ const bool mAltSort;
};
//---------------------------------------------------------------------------
@@ -213,6 +222,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
mSearchColumn(p.search_column),
mColumnPadding(p.column_padding),
mRowPadding(p.row_padding),
+ mAlternateSort(false),
mContextMenuType(MENU_NONE),
mIsFriendSignal(NULL)
{
@@ -2679,7 +2689,7 @@ void LLScrollListCtrl::updateSort() const
std::stable_sort(
mItemList.begin(),
mItemList.end(),
- SortScrollListItem(mSortColumns,mSortCallback));
+ SortScrollListItem(mSortColumns,mSortCallback, mAlternateSort));
mSorted = true;
}
@@ -2695,7 +2705,7 @@ void LLScrollListCtrl::sortOnce(S32 column, BOOL ascending)
std::stable_sort(
mItemList.begin(),
mItemList.end(),
- SortScrollListItem(sort_column,mSortCallback));
+ SortScrollListItem(sort_column,mSortCallback,mAlternateSort));
}
void LLScrollListCtrl::dirtyColumns()