summaryrefslogtreecommitdiff
path: root/indra/newview/llnamelistctrl.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-01-26 20:17:45 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2010-01-26 20:17:45 +0200
commitdfad0f4e67821670cfc806dd2f8fcdf9a0d96530 (patch)
treed297bb8dfc88f523f8837488bb697d2ae0da80e3 /indra/newview/llnamelistctrl.cpp
parent5344f82e282ed4ce1c016c1e164f674f64bb78be (diff)
Fixed critical bug EXT-4663 ([BSI] Inviting Residents to groups produces error 100% of time).
Overriden LLScrollListItem::getUUID() in LLNameListCtrl so that you can get correct ID of a name list item. --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llnamelistctrl.cpp')
-rw-r--r--indra/newview/llnamelistctrl.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index 6375362ae2..9f04558d50 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -148,7 +148,7 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask)
&& column_index == mNameColumnIndex)
{
// ...this is the column with the avatar name
- LLUUID avatar_id = getItemId(hit_item);
+ LLUUID avatar_id = hit_item->getUUID();
if (avatar_id.notNull())
{
// ...valid avatar id
@@ -230,14 +230,15 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(
std::string& suffix)
{
LLUUID id = name_item.value().asUUID();
- LLScrollListItem* item = NULL;
+ LLNameListItem* item = NULL;
// Store item type so that we can invoke the proper inspector.
// *TODO Vadim: Is there a more proper way of storing additional item data?
{
- LLNameListCtrl::NameItem name_item_(name_item);
- name_item_.value = LLSD().with("uuid", id).with("is_group", name_item.target() == GROUP);
- item = LLScrollListCtrl::addRow(name_item_, pos);
+ LLNameListCtrl::NameItem item_p(name_item);
+ item_p.value = LLSD().with("uuid", id).with("is_group", name_item.target() == GROUP);
+ item = new LLNameListItem(item_p);
+ LLScrollListCtrl::addRow(item, item_p, pos);
}
if (!item) return NULL;
@@ -298,7 +299,7 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id)
for (item_list::iterator it = getItemList().begin(); it != getItemList().end(); it++)
{
LLScrollListItem* item = *it;
- if (getItemId(item) == agent_id)
+ if (item->getUUID() == agent_id)
{
idx = getItemIndex(item);
break;
@@ -335,7 +336,7 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first,
for (iter = getItemList().begin(); iter != getItemList().end(); iter++)
{
LLScrollListItem* item = *iter;
- if (getItemId(item) == id)
+ if (item->getUUID() == id)
{
LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(0);
cell = item->getColumn(mNameColumnIndex);
@@ -375,9 +376,3 @@ void LLNameListCtrl::updateColumns()
}
}
}
-
-// static
-LLUUID LLNameListCtrl::getItemId(LLScrollListItem* item)
-{
- return item->getValue()["uuid"].asUUID();
-}