From 83c1ca9a0539e7c458927c88f7795963f56b4bf7 Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Wed, 16 Jun 2010 16:10:16 +0300 Subject: EXT-7693 ADDITIONAL FIX Added assertion in the type_map to make sure xml and code are in sync --HG-- branch : product-engine --- indra/newview/llcofwearables.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'indra/newview/llcofwearables.cpp') diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 880d79222b..46d2e0a5db 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -576,7 +576,9 @@ void LLCOFWearables::clear() LLAssetType::EType LLCOFWearables::getExpandedAccordionAssetType() { - static std::map type_map; + typedef std::map type_map_t; + + static type_map_t type_map; static LLAccordionCtrl* accordion_ctrl = getChild("cof_wearables_accordion"); if (type_map.empty()) @@ -587,14 +589,16 @@ LLAssetType::EType LLCOFWearables::getExpandedAccordionAssetType() } const LLAccordionCtrlTab* tab = accordion_ctrl->getExpandedTab(); + LLAssetType::EType result = LLAssetType::AT_NONE; - if (!tab) + if (tab) { - llwarns << "No accordion is expanded" << llendl; - return LLAssetType::AT_NONE; + type_map_t::iterator i = type_map.find(tab->getName()); + llassert(i != type_map.end()); + result = i->second; } - return type_map[tab->getName()]; + return result; } void LLCOFWearables::onListRightClick(LLUICtrl* ctrl, S32 x, S32 y, LLListContextMenu* menu) -- cgit v1.2.3