aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llnamelistctrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llnamelistctrl.cpp')
-rw-r--r--linden/indra/newview/llnamelistctrl.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/linden/indra/newview/llnamelistctrl.cpp b/linden/indra/newview/llnamelistctrl.cpp
index 564677a..b8bda78 100644
--- a/linden/indra/newview/llnamelistctrl.cpp
+++ b/linden/indra/newview/llnamelistctrl.cpp
@@ -44,14 +44,14 @@ static LLRegisterWidget<LLNameListCtrl> r("name_list");
44// statics 44// statics
45std::set<LLNameListCtrl*> LLNameListCtrl::sInstances; 45std::set<LLNameListCtrl*> LLNameListCtrl::sInstances;
46 46
47LLNameListCtrl::LLNameListCtrl(const LLString& name, 47LLNameListCtrl::LLNameListCtrl(const std::string& name,
48 const LLRect& rect, 48 const LLRect& rect,
49 LLUICtrlCallback cb, 49 LLUICtrlCallback cb,
50 void* userdata, 50 void* userdata,
51 BOOL allow_multiple_selection, 51 BOOL allow_multiple_selection,
52 BOOL draw_border, 52 BOOL draw_border,
53 S32 name_column_index, 53 S32 name_column_index,
54 const LLString& tooltip) 54 const std::string& tooltip)
55: LLScrollListCtrl(name, rect, cb, userdata, allow_multiple_selection, 55: LLScrollListCtrl(name, rect, cb, userdata, allow_multiple_selection,
56 draw_border), 56 draw_border),
57 mNameColumnIndex(name_column_index), 57 mNameColumnIndex(name_column_index),
@@ -71,7 +71,7 @@ LLNameListCtrl::~LLNameListCtrl()
71 71
72// public 72// public
73BOOL LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos, 73BOOL LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos,
74 BOOL enabled, LLString& suffix) 74 BOOL enabled, std::string& suffix)
75{ 75{
76 //llinfos << "LLNameListCtrl::addNameItem " << agent_id << llendl; 76 //llinfos << "LLNameListCtrl::addNameItem " << agent_id << llendl;
77 77
@@ -91,7 +91,7 @@ BOOL LLNameListCtrl::handleDragAndDrop(
91 BOOL drop, 91 BOOL drop,
92 EDragAndDropType cargo_type, void *cargo_data, 92 EDragAndDropType cargo_type, void *cargo_data,
93 EAcceptance *accept, 93 EAcceptance *accept,
94 LLString& tooltip_msg) 94 std::string& tooltip_msg)
95{ 95{
96 if (!mAllowCallingCardDrop) 96 if (!mAllowCallingCardDrop)
97 { 97 {
@@ -153,7 +153,7 @@ void LLNameListCtrl::addGroupNameItem(LLScrollListItem* item, EAddPosition pos)
153 gCacheName->getGroupName(item->getUUID(), group_name); 153 gCacheName->getGroupName(item->getUUID(), group_name);
154 154
155 LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); 155 LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex);
156 ((LLScrollListText*)cell)->setText( LLString(group_name) ); 156 ((LLScrollListText*)cell)->setText( std::string(group_name) );
157 157
158 addItem(item, pos); 158 addItem(item, pos);
159} 159}
@@ -234,19 +234,20 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id)
234} 234}
235 235
236// public 236// public
237void LLNameListCtrl::refresh(const LLUUID& id, const char* first, 237void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first,
238 const char* last, 238 const std::string& last, BOOL is_group)
239 BOOL is_group)
240{ 239{
241 //llinfos << "LLNameListCtrl::refresh " << id << " '" << first << " " 240 //llinfos << "LLNameListCtrl::refresh " << id << " '" << first << " "
242 // << last << "'" << llendl; 241 // << last << "'" << llendl;
243 242
244 LLString fullname; 243 std::string fullname;
245 fullname.assign(first); 244 if (!is_group)
246 if (last[0] && !is_group) 245 {
246 fullname = first + " " + last;
247 }
248 else
247 { 249 {
248 fullname.append(1, ' '); 250 fullname = first;
249 fullname.append(last);
250 } 251 }
251 252
252 // TODO: scan items for that ID, fix if necessary 253 // TODO: scan items for that ID, fix if necessary
@@ -268,9 +269,8 @@ void LLNameListCtrl::refresh(const LLUUID& id, const char* first,
268 269
269 270
270// static 271// static
271void LLNameListCtrl::refreshAll(const LLUUID& id, const char* first, 272void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& first,
272 const char* last, 273 const std::string& last, BOOL is_group)
273 BOOL is_group)
274{ 274{
275 std::set<LLNameListCtrl*>::iterator it; 275 std::set<LLNameListCtrl*>::iterator it;
276 for (it = LLNameListCtrl::sInstances.begin(); 276 for (it = LLNameListCtrl::sInstances.begin();
@@ -301,7 +301,7 @@ LLXMLNodePtr LLNameListCtrl::getXML(bool save_children) const
301 301
302LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) 302LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
303{ 303{
304 LLString name("name_list"); 304 std::string name("name_list");
305 node->getAttributeString("name", name); 305 node->getAttributeString("name", name);
306 306
307 LLRect rect; 307 LLRect rect;
@@ -355,16 +355,16 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
355 { 355 {
356 if (child->hasName("column")) 356 if (child->hasName("column"))
357 { 357 {
358 LLString labelname(""); 358 std::string labelname("");
359 child->getAttributeString("label", labelname); 359 child->getAttributeString("label", labelname);
360 360
361 LLString columnname(labelname); 361 std::string columnname(labelname);
362 child->getAttributeString("name", columnname); 362 child->getAttributeString("name", columnname);
363 363
364 BOOL columndynamicwidth = FALSE; 364 BOOL columndynamicwidth = FALSE;
365 child->getAttributeBOOL("dynamicwidth", columndynamicwidth); 365 child->getAttributeBOOL("dynamicwidth", columndynamicwidth);
366 366
367 LLString sortname(columnname); 367 std::string sortname(columnname);
368 child->getAttributeString("sort", sortname); 368 child->getAttributeString("sort", sortname);
369 369
370 S32 columnwidth = -1; 370 S32 columnwidth = -1;
@@ -415,15 +415,15 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
415 { 415 {
416 if (row_child->hasName("column")) 416 if (row_child->hasName("column"))
417 { 417 {
418 LLString value = row_child->getTextContents(); 418 std::string value = row_child->getTextContents();
419 419
420 LLString columnname(""); 420 std::string columnname("");
421 row_child->getAttributeString("name", columnname); 421 row_child->getAttributeString("name", columnname);
422 422
423 LLString font(""); 423 std::string font("");
424 row_child->getAttributeString("font", font); 424 row_child->getAttributeString("font", font);
425 425
426 LLString font_style(""); 426 std::string font_style("");
427 row_child->getAttributeString("font-style", font_style); 427 row_child->getAttributeString("font-style", font_style);
428 428
429 row["columns"][column_idx]["column"] = columnname; 429 row["columns"][column_idx]["column"] = columnname;
@@ -437,7 +437,7 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
437 } 437 }
438 } 438 }
439 439
440 LLString contents = node->getTextContents(); 440 std::string contents = node->getTextContents();
441 441
442 typedef boost::tokenizer<boost::char_separator<char> > tokenizer; 442 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
443 boost::char_separator<char> sep("\t\n"); 443 boost::char_separator<char> sep("\t\n");
@@ -446,7 +446,7 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
446 446
447 while(token_iter != tokens.end()) 447 while(token_iter != tokens.end())
448 { 448 {
449 const char* line = token_iter->c_str(); 449 const std::string& line = *token_iter;
450 name_list->addCommentText(line); 450 name_list->addCommentText(line);
451 ++token_iter; 451 ++token_iter;
452 } 452 }