From fc6cfc27bec61ac1f66c1304cc7b54f19157584e Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Tue, 24 Nov 2009 14:37:48 -0500
Subject: [PATCH] Fix for EXT-2571 to accommodate accordion panels

--HG--
branch : avatar-pipeline
---
 indra/newview/llinventorybridge.cpp       |  8 ++++++--
 indra/newview/llpaneloutfitsinventory.cpp | 11 +++++++++++
 indra/newview/llpaneloutfitsinventory.h   |  1 +
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 628db462818..3e847f11ce3 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2346,8 +2346,12 @@ bool isInOutfitsSidePanel(LLPanel *panel)
 	LLInventoryPanel *my_panel = dynamic_cast<LLInventoryPanel*>(panel);
 	LLPanelOutfitsInventory *outfit_panel =
 		dynamic_cast<LLPanelOutfitsInventory*>(LLSideTray::getInstance()->getPanel("panel_outfits_inventory"));
-	LLInventoryPanel *outfit_inv_panel = outfit_panel ? outfit_panel->getActivePanel(): NULL;
-	return (my_panel && (my_panel == outfit_inv_panel));
+	if (!outfit_panel)
+		return false;
+	return outfit_panel->isAccordionPanel(my_panel);
+
+	//LLInventoryPanel *outfit_inv_panel = outfit_panel ? outfit_panel->getActivePanel(): NULL;
+	//return (my_panel && (my_panel == outfit_inv_panel));
 }
 
 void LLFolderBridge::folderOptionsMenu()
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index 2550962d764..e66a4440e95 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -398,3 +398,14 @@ LLInventoryPanel* LLPanelOutfitsInventory::getActivePanel()
 	return mActivePanel;
 }
 
+bool LLPanelOutfitsInventory::isAccordionPanel(LLInventoryPanel *panel)
+{
+	for(accordionpanels_vec_t::iterator it = mAccordionPanels.begin();
+		it != mAccordionPanels.end();
+		++it)
+	{
+		if (*it == panel)
+			return true;
+	}
+	return false;
+}
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index 902a5caab81..7769a7d1729 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -78,6 +78,7 @@ class LLPanelOutfitsInventory : public LLPanel
 	//////////////////////////////////////////////////////////////////////////////////
 	// Accordion                                                                    //
 	LLInventoryPanel* 	getActivePanel();
+	bool isAccordionPanel(LLInventoryPanel *panel);
 	
 protected:
 	void 				initAccordionPanels();
-- 
GitLab