From bff974cdb896adfe6773433ada50a451ecf96e76 Mon Sep 17 00:00:00 2001
From: Igor Borovkov <iborovkov@productengine.com>
Date: Mon, 7 Jun 2010 12:10:36 +0300
Subject: [PATCH] EXT-7406 FIXED extended find wearables of type functor to
 filter out links (panel outfit edit)

extended find wearables of type functor to filter out links

Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/522

--HG--
branch : product-engine
---
 indra/newview/llinventoryfunctions.h | 13 +++++++++++++
 indra/newview/llpaneloutfitedit.cpp  |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index 33b52cfd5e6..c82ebd1439f 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -324,6 +324,19 @@ class LLFindWearablesOfType : public LLInventoryCollectFunctor
 	LLWearableType::EType mWearableType;
 };
 
+/** Filter out wearables-links */
+class LLFindActualWearablesOfType : public LLFindWearablesOfType
+{
+public:
+	LLFindActualWearablesOfType(LLWearableType::EType type) : LLFindWearablesOfType(type) {}
+	virtual ~LLFindActualWearablesOfType() {}
+	virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item)
+	{
+		if (item && item->getIsLinkType()) return false;
+		return LLFindWearablesOfType::operator()(cat, item);
+	}
+};
+
 // Find worn items.
 class LLFindWorn : public LLInventoryCollectFunctor
 {
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index ea7410502d7..ce382541c67 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -280,7 +280,7 @@ BOOL LLPanelOutfitEdit::postBuild()
 	childSetAction(REVERT_BTN, boost::bind(&LLAppearanceMgr::wearBaseOutfit, LLAppearanceMgr::getInstance()));
 
 	mWearableListMaskCollector = new LLFindNonLinksByMask(ALL_ITEMS_MASK);
-	mWearableListTypeCollector = new LLFindWearablesOfType(LLWearableType::WT_NONE);
+	mWearableListTypeCollector = new LLFindActualWearablesOfType(LLWearableType::WT_NONE);
 
 	mWearableItemsPanel = getChild<LLPanel>("filtered_wearables_panel");
 	mWearableItemsList = getChild<LLInventoryItemsList>("filtered_wearables_list");
-- 
GitLab