summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2016-06-03 17:53:24 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2016-06-03 17:53:24 +0300
commit2da3148759760abc97fdcb51b1feb6db28c38277 (patch)
tree1e289a9843aa8fabceeab1b1515cadfad01baa17 /indra
parente2e208898be7bcc3d3801bfd537a5d84201a1563 (diff)
MAINT-6475 FIXED Inconsistent sort order in "Outfit Gallery" tab
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lloutfitgallery.cpp19
-rw-r--r--indra/newview/lloutfitgallery.h15
2 files changed, 18 insertions, 16 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)
{
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<LLViewerTexture> mTexturep;