From d464901e47ab0d55597a6a5b3b65a18492ef8004 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 16 Apr 2025 14:30:35 +0300 Subject: Post-merge fix compareGalleryItem() in lloutfitgallery.cpp (#3917) --- indra/newview/lloutfitgallery.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 1767990aed..7ab63be009 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -432,24 +432,28 @@ bool compareGalleryItem(LLOutfitGalleryItem* item1, LLOutfitGalleryItem* item2) switch (sort_by_name()) { case 2: + // Sort by favorites - favorite items first, then alphabetically if (item1->isFavorite() != item2->isFavorite()) { return item1->isFavorite(); + } break; case 1: + // Sort by images - items with non-default images first, then alphabetically if (item1->isDefaultImage() != item2->isDefaultImage()) + { + return item2->isDefaultImage(); + } break; default: + // Sort alphabetically only break; } + // Final comparison is always alphabetical by name std::string name1 = item1->getItemName(); std::string name2 = item2->getItemName(); return (LLStringUtil::compareDict(name1, name2) < 0); - } - { - return item2->isDefaultImage(); - } } void LLOutfitGallery::reArrangeRows(S32 row_diff) -- cgit v1.2.3