diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2016-06-03 17:53:24 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2016-06-03 17:53:24 +0300 |
commit | 2da3148759760abc97fdcb51b1feb6db28c38277 (patch) | |
tree | 1e289a9843aa8fabceeab1b1515cadfad01baa17 /indra/newview/lloutfitgallery.cpp | |
parent | e2e208898be7bcc3d3801bfd537a5d84201a1563 (diff) |
MAINT-6475 FIXED Inconsistent sort order in "Outfit Gallery" tab
Diffstat (limited to 'indra/newview/lloutfitgallery.cpp')
-rw-r--r-- | indra/newview/lloutfitgallery.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index f6af3d63f6..a4315b9189 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -145,6 +145,23 @@ void LLOutfitGallery::updateRowsIfNeeded() } } +bool compareGalleryItem(LLOutfitGalleryItem* item1, LLOutfitGalleryItem* item2) +{ + if((item1->mIsDefaultImage() && item2->mIsDefaultImage()) || (!item1->mIsDefaultImage() && !item2->mIsDefaultImage())) + { + std::string name1 = item1->getItemName(); + std::string name2 = item2->getItemName(); + + LLStringUtil::toUpper(name1); + LLStringUtil::toUpper(name2); + return name1 < name2; + } + else + { + return item2->mIsDefaultImage(); + } +} + void LLOutfitGallery::reArrangeRows(S32 row_diff) { @@ -161,7 +178,7 @@ void LLOutfitGallery::reArrangeRows(S32 row_diff) mItemsInRow+= row_diff; updateGalleryWidth(); - std::sort(buf_items.begin(), buf_items.end(), LLOutfitGalleryItem::compareGalleryItem()); + std::sort(buf_items.begin(), buf_items.end(), compareGalleryItem); for (std::vector<LLOutfitGalleryItem*>::const_iterator it = buf_items.begin(); it != buf_items.end(); ++it) { |