diff options
-rw-r--r-- | indra/newview/lloutfitgallery.cpp | 19 | ||||
-rw-r--r-- | indra/newview/lloutfitgallery.h | 15 |
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; |