From 2da3148759760abc97fdcb51b1feb6db28c38277 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 3 Jun 2016 17:53:24 +0300 Subject: MAINT-6475 FIXED Inconsistent sort order in "Outfit Gallery" tab --- indra/newview/lloutfitgallery.cpp | 19 ++++++++++++++++++- indra/newview/lloutfitgallery.h | 15 --------------- 2 files changed, 18 insertions(+), 16 deletions(-) (limited to 'indra') 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::const_iterator it = buf_items.begin(); it != buf_items.end(); ++it) { diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index ad3f2a7129..385a1e1c7a 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -258,21 +258,6 @@ public: bool isHidden() {return mHidden;} void setHidden(bool hidden) {mHidden = hidden;} - - struct compareGalleryItem - { - bool operator()(LLOutfitGalleryItem* a, LLOutfitGalleryItem* b) - { - if((a->mIsDefaultImage() && b->mIsDefaultImage()) || (!a->mIsDefaultImage() && !b->mIsDefaultImage())) - { - return a->getItemName().compare(b->getItemName()) < 0; - } - else - { - return b->mIsDefaultImage(); - } - } - }; private: LLPointer mTexturep; -- cgit v1.2.3