From 8f81b5dbe4ff0a0d6486e5325250650986f6a81e Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 24 Dec 2009 14:31:48 +0200 Subject: Work on normal task EXT-3636 (Code Improvements: Voice control panels - Make Voice states and fade timeout xml driven) -- Code cleaned up: renamed variables related to item styles, -- changed signature of LLAvatarListItem::getItemStylesParams & LLAvatarListItem::getItemIconColorMap to return a reference to avoid calling of plural copy constructors. --HG-- branch : product-engine --- indra/newview/llavatarlistitem.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/newview/llavatarlistitem.cpp') diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 61361d78e6..8bc11b0c1c 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -178,19 +178,19 @@ void LLAvatarListItem::setHighlight(const std::string& highlight) setNameInternal(mAvatarName->getText(), mHighlihtSubstring = highlight); } -void LLAvatarListItem::setStyle(EItemStyle voice_state) +void LLAvatarListItem::setStyle(EItemStyle item_style) { - voice_state_map_t mVoiceStateMap = getItemStylesParams(); + item_style_map_t& item_styles_params_map = getItemStylesParams(); - mAvatarNameStyle = mVoiceStateMap[voice_state]; + mAvatarNameStyle = item_styles_params_map[item_style]; // *NOTE: You cannot set the style on a text box anymore, you must // rebuild the text. This will cause problems if the text contains // hyperlinks, as their styles will be wrong. setNameInternal(mAvatarName->getText(), mHighlihtSubstring); - icon_color_map_t item_icon_color_map = getItemIconColorMap(); - mAvatarIcon->setColor(item_icon_color_map[voice_state]); + icon_color_map_t& item_icon_color_map = getItemIconColorMap(); + mAvatarIcon->setColor(item_icon_color_map[item_style]); } void LLAvatarListItem::setAvatarId(const LLUUID& id, bool ignore_status_changes) @@ -408,9 +408,9 @@ std::string LLAvatarListItem::formatSeconds(U32 secs) } // static -LLAvatarListItem::voice_state_map_t LLAvatarListItem::getItemStylesParams() +LLAvatarListItem::item_style_map_t& LLAvatarListItem::getItemStylesParams() { - static voice_state_map_t item_styles_params_map; + static item_style_map_t item_styles_params_map; if (!item_styles_params_map.empty()) return item_styles_params_map; LLPanel::Params params = LLUICtrlFactory::getDefaultParams(); @@ -460,7 +460,7 @@ LLAvatarListItem::voice_state_map_t LLAvatarListItem::getItemStylesParams() } // static -LLAvatarListItem::icon_color_map_t LLAvatarListItem::getItemIconColorMap() +LLAvatarListItem::icon_color_map_t& LLAvatarListItem::getItemIconColorMap() { static icon_color_map_t item_icon_color_map; if (!item_icon_color_map.empty()) return item_icon_color_map; -- cgit v1.2.3