summaryrefslogtreecommitdiff
path: root/indra/newview/llnamelistctrl.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-02-19 21:42:32 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-02-19 21:42:32 +0000
commit2e32d44e7165775936beae5d9ef636ff9d3f2bd2 (patch)
tree8153bc399994aabf6e1c41c2d8332e4e8c4ddb78 /indra/newview/llnamelistctrl.cpp
parentdb0f5847ea8b96b3c1ac08e7aeb43d83daacb8e4 (diff)
merge svn+ssh://svn.lindenlab.com/svn/linden/qa/combo-merge-ui-2008-02-13 -r 79986 : 80178 -> release.
QAR-290 = QAR-271 + QAR-191
Diffstat (limited to 'indra/newview/llnamelistctrl.cpp')
-rw-r--r--indra/newview/llnamelistctrl.cpp43
1 files changed, 12 insertions, 31 deletions
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index 9dd37cf47d..a3faa55a06 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -73,15 +73,9 @@ BOOL LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos,
{
//llinfos << "LLNameListCtrl::addNameItem " << agent_id << llendl;
- char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
- char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
+ std::string fullname;
+ BOOL result = gCacheName->getFullName(agent_id, fullname);
- BOOL result = gCacheName->getName(agent_id, first, last);
-
- LLString fullname;
- fullname.assign(first);
- fullname.append(1, ' ');
- fullname.append(last);
fullname.append(suffix);
addStringUUIDItem(fullname, agent_id, pos, enabled);
@@ -142,7 +136,7 @@ void LLNameListCtrl::addGroupNameItem(const LLUUID& group_id, EAddPosition pos,
BOOL enabled)
{
//llinfos << "LLNameListCtrl::addGroupNameItem " << group_id << llendl;
- char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
+ std::string group_name;
gCacheName->getGroupName(group_id, group_name);
addStringUUIDItem(group_name, group_id, pos, enabled);
}
@@ -153,7 +147,7 @@ void LLNameListCtrl::addGroupNameItem(LLScrollListItem* item, EAddPosition pos)
{
//llinfos << "LLNameListCtrl::addGroupNameItem " << item->getUUID() << llendl;
- char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
+ std::string group_name;
gCacheName->getGroupName(item->getUUID(), group_name);
LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex);
@@ -166,15 +160,8 @@ BOOL LLNameListCtrl::addNameItem(LLScrollListItem* item, EAddPosition pos)
{
//llinfos << "LLNameListCtrl::addNameItem " << item->getUUID() << llendl;
- char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
- char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
-
- BOOL result = gCacheName->getName(item->getUUID(), first, last);
-
- LLString fullname;
- fullname.assign(first);
- fullname.append(1, ' ');
- fullname.append(last);
+ std::string fullname;
+ BOOL result = gCacheName->getFullName(item->getUUID(), fullname);
LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex);
((LLScrollListText*)cell)->setText( fullname );
@@ -195,17 +182,12 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& value, EAddPosition pos
{
LLScrollListItem* item = LLScrollListCtrl::addElement(value, pos, userdata);
- char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
- char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
-
// use supplied name by default
- LLString fullname = value["name"].asString();
+ std::string fullname = value["name"].asString();
if (value["target"].asString() == "GROUP")
{
- char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
- gCacheName->getGroupName(item->getUUID(), group_name);
+ gCacheName->getGroupName(item->getUUID(), fullname);
// fullname will be "nobody" if group not found
- fullname = group_name;
}
else if (value["target"].asString() == "SPECIAL")
{
@@ -213,11 +195,10 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& value, EAddPosition pos
}
else // normal resident
{
- if (gCacheName->getName(item->getUUID(), first, last))
+ std::string name;
+ if (gCacheName->getFullName(item->getUUID(), name))
{
- fullname.assign(first);
- fullname.append(1, ' ');
- fullname.append(last);
+ fullname = name;
}
}
@@ -268,7 +249,7 @@ void LLNameListCtrl::refresh(const LLUUID& id, const char* first,
// TODO: scan items for that ID, fix if necessary
item_list::iterator iter;
- for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
+ for (iter = getItemList().begin(); iter != getItemList().end(); iter++)
{
LLScrollListItem* item = *iter;
if (item->getUUID() == id)