summaryrefslogtreecommitdiff
path: root/indra/newview/llcofwearables.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-05-14 10:28:38 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-05-14 10:28:38 +0100
commit80b6569105acc7990d21a22c30c29675534d0a85 (patch)
tree1807e6105869b66efc16b3b4e30d47ae4440ba16 /indra/newview/llcofwearables.cpp
parentd79351e689be5b0771b02843ad2ca1c35717394d (diff)
parenta5f365c331149b03366be421aa1597dfbcb1bb33 (diff)
merge from viewer-public
Diffstat (limited to 'indra/newview/llcofwearables.cpp')
-rw-r--r--indra/newview/llcofwearables.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index 498aeec682..8d4430a9ea 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -46,6 +46,20 @@ static LLRegisterPanelClassWrapper<LLCOFWearables> t_cof_wearables("cof_wearable
const LLSD REARRANGE = LLSD().with("rearrange", LLSD());
+static const LLWearableItemNameComparator WEARABLE_NAME_COMPARATOR;
+
+
+bool LLWearableItemNameComparator::doCompare(const LLPanelWearableListItem* wearable_item1, const LLPanelWearableListItem* wearable_item2) const
+{
+ std::string name1 = wearable_item1->getItemName();
+ std::string name2 = wearable_item2->getItemName();
+
+ LLStringUtil::toUpper(name1);
+ LLStringUtil::toUpper(name2);
+
+ return name1 < name2;
+}
+
LLCOFWearables::LLCOFWearables() : LLPanel(),
mAttachments(NULL),
@@ -73,6 +87,10 @@ BOOL LLCOFWearables::postBuild()
mClothing->setCommitOnSelectionChange(true);
mBodyParts->setCommitOnSelectionChange(true);
+ //clothing is sorted according to its position relatively to the body
+ mAttachments->setComparator(&WEARABLE_NAME_COMPARATOR);
+ mBodyParts->setComparator(&WEARABLE_NAME_COMPARATOR);
+
return LLPanel::postBuild();
}
@@ -164,16 +182,15 @@ void LLCOFWearables::populateAttachmentsAndBodypartsLists(const LLInventoryModel
if (mAttachments->size())
{
- mAttachments->sort(); //*TODO by Name
+ mAttachments->sort();
mAttachments->notify(REARRANGE); //notifying the parent about the list's size change (cause items were added with rearrange=false)
}
if (mBodyParts->size())
{
- mBodyParts->sort(); //*TODO by name
+ mBodyParts->sort();
+ mBodyParts->notify(REARRANGE);
}
-
- mBodyParts->notify(REARRANGE);
}
//create a clothing list item, update verbs and show/hide line separator