summaryrefslogtreecommitdiff
path: root/indra/newview/llnearbychatbar.cpp
diff options
context:
space:
mode:
authorChristian Goetze (CG) <cg@lindenlab.com>2010-08-02 15:57:01 -0700
committerChristian Goetze (CG) <cg@lindenlab.com>2010-08-02 15:57:01 -0700
commit4f6e814eaa7ae5cfc10e4e7d1f22e53be395a2f4 (patch)
treebe554f9f22996e00dada6da67f7e77eb0502b0f5 /indra/newview/llnearbychatbar.cpp
parentf423a69864c40f760c1c7e64a2e544fd1dba77fb (diff)
parent15247f086989a43881d79c1ee5416bb00721eb68 (diff)
Fix the reversion imported from viewer-hotfix via: "hg pull -r 1c95812ba38b ../viewer-public" - reviewed by richard
Diffstat (limited to 'indra/newview/llnearbychatbar.cpp')
-rw-r--r--indra/newview/llnearbychatbar.cpp44
1 files changed, 11 insertions, 33 deletions
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index 6c1fb69c02..a300e15edd 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -317,19 +317,9 @@ void LLGestureComboList::refreshGestures()
if (gestures)
{
- S32 sel_index = gestures->getFirstSelectedIndex();
- if (sel_index != 0)
- {
- S32 index = gestures->getSelectedValue().asInteger();
- if (index<0 || index >= (S32)mGestures.size())
- {
- llwarns << "out of range gesture access" << llendl;
- }
- else
- {
- gesture = mGestures.at(index);
- }
- }
+ S32 index = gestures->getSelectedValue().asInteger();
+ if(index > 0)
+ gesture = mGestures.at(index);
}
if(gesture && LLGestureMgr::instance().isGesturePlaying(gesture))
@@ -345,13 +335,13 @@ void LLGestureComboList::onCommitGesture()
LLCtrlListInterface* gestures = getListInterface();
if (gestures)
{
- S32 sel_index = gestures->getFirstSelectedIndex();
- if (sel_index == 0)
+ S32 index = gestures->getFirstSelectedIndex();
+ if (index == 0)
{
return;
}
- S32 index = gestures->getSelectedValue().asInteger();
+ index = gestures->getSelectedValue().asInteger();
if (mViewAllItemIndex == index)
{
@@ -367,20 +357,13 @@ void LLGestureComboList::onCommitGesture()
return;
}
- if (index<0 || index >= (S32)mGestures.size())
- {
- llwarns << "out of range gesture index" << llendl;
- }
- else
+ LLMultiGesture* gesture = mGestures.at(index);
+ if(gesture)
{
- LLMultiGesture* gesture = mGestures.at(index);
- if(gesture)
+ LLGestureMgr::instance().playGesture(gesture);
+ if(!gesture->mReplaceText.empty())
{
- LLGestureMgr::instance().playGesture(gesture);
- if(!gesture->mReplaceText.empty())
- {
- LLNearbyChatBar::sendChatFromViewer(gesture->mReplaceText, CHAT_TYPE_NORMAL, FALSE);
- }
+ LLNearbyChatBar::sendChatFromViewer(gesture->mReplaceText, CHAT_TYPE_NORMAL, FALSE);
}
}
}
@@ -391,11 +374,6 @@ LLGestureComboList::~LLGestureComboList()
LLGestureMgr::instance().removeObserver(this);
}
-LLCtrlListInterface* LLGestureComboList::getListInterface()
-{
- return mList;
-};
-
LLNearbyChatBar::LLNearbyChatBar()
: LLPanel()
, mChatBox(NULL)