diff options
Diffstat (limited to 'linden/indra/newview/llchatbar.cpp')
-rw-r--r-- | linden/indra/newview/llchatbar.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp index 3a6c8cf..31fa653 100644 --- a/linden/indra/newview/llchatbar.cpp +++ b/linden/indra/newview/llchatbar.cpp | |||
@@ -216,15 +216,14 @@ void LLChatBar::refresh() | |||
216 | 216 | ||
217 | void LLChatBar::refreshGestures() | 217 | void LLChatBar::refreshGestures() |
218 | { | 218 | { |
219 | LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL; | 219 | if (mGestureCombo) |
220 | if (mGestureCombo && gestures) | ||
221 | { | 220 | { |
222 | //store current selection so we can maintain it | 221 | //store current selection so we can maintain it |
223 | std::string cur_gesture = mGestureCombo->getValue().asString(); | 222 | std::string cur_gesture = mGestureCombo->getValue().asString(); |
224 | gestures->selectFirstItem(); | 223 | mGestureCombo->selectFirstItem(); |
225 | std::string label = mGestureCombo->getValue().asString();; | 224 | std::string label = mGestureCombo->getValue().asString();; |
226 | // clear | 225 | // clear |
227 | gestures->clearRows(); | 226 | mGestureCombo->clearRows(); |
228 | 227 | ||
229 | // collect list of unique gestures | 228 | // collect list of unique gestures |
230 | std::map <std::string, BOOL> unique; | 229 | std::map <std::string, BOOL> unique; |
@@ -245,20 +244,21 @@ void LLChatBar::refreshGestures() | |||
245 | std::map <std::string, BOOL>::iterator it2; | 244 | std::map <std::string, BOOL>::iterator it2; |
246 | for (it2 = unique.begin(); it2 != unique.end(); ++it2) | 245 | for (it2 = unique.begin(); it2 != unique.end(); ++it2) |
247 | { | 246 | { |
248 | gestures->addSimpleElement((*it2).first); | 247 | mGestureCombo->addSimpleElement((*it2).first); |
249 | } | 248 | } |
250 | 249 | ||
251 | gestures->sortByColumn(LLStringUtil::null, TRUE); | 250 | mGestureCombo->sortByName(); |
252 | // Insert label after sorting | 251 | // Insert label after sorting, at top, with separator below it |
253 | gestures->addSimpleElement(label, ADD_TOP); | 252 | mGestureCombo->addSeparator(ADD_TOP); |
253 | mGestureCombo->addSimpleElement(getString("gesture_label"), ADD_TOP); | ||
254 | 254 | ||
255 | if (!cur_gesture.empty()) | 255 | if (!cur_gesture.empty()) |
256 | { | 256 | { |
257 | gestures->selectByValue(LLSD(cur_gesture)); | 257 | mGestureCombo->selectByValue(LLSD(cur_gesture)); |
258 | } | 258 | } |
259 | else | 259 | else |
260 | { | 260 | { |
261 | gestures->selectFirstItem(); | 261 | mGestureCombo->selectFirstItem(); |
262 | } | 262 | } |
263 | } | 263 | } |
264 | } | 264 | } |