summaryrefslogtreecommitdiff
path: root/indra/newview/llnamelistctrl.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-11-19 11:31:01 -0500
committerOz Linden <oz@lindenlab.com>2012-11-19 11:31:01 -0500
commitf362666df729a6653c04b98d287cfedacaf3ed9f (patch)
treef45fda952f6abb3f92ecde17daa22e11f2a1b76e /indra/newview/llnamelistctrl.cpp
parentf99d7bcd475aacffa11b740cf7042cdae77590de (diff)
parent6cd16bc537a9978db75e1c1fa0fda0af99cb3cdf (diff)
merge changes for DRTVWR-245
Diffstat (limited to 'indra/newview/llnamelistctrl.cpp')
-rw-r--r--indra/newview/llnamelistctrl.cpp27
1 files changed, 10 insertions, 17 deletions
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index 472c26e22d..b0fbad33b0 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -68,7 +68,7 @@ LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p)
{}
// public
-void LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos,
+LLScrollListItem* LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos,
BOOL enabled, const std::string& suffix)
{
//llinfos << "LLNameListCtrl::addNameItem " << agent_id << llendl;
@@ -78,7 +78,7 @@ void LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos,
item.enabled = enabled;
item.target = INDIVIDUAL;
- addNameItemRow(item, pos, suffix);
+ return addNameItemRow(item, pos, suffix);
}
// virtual, public
@@ -204,7 +204,7 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask)
{
BOOL handled = FALSE;
S32 column_index = getColumnIndexFromOffset(x);
- LLScrollListItem* hit_item = hitItem(x, y);
+ LLNameListItem* hit_item = dynamic_cast<LLNameListItem*>(hitItem(x, y));
if (hit_item
&& column_index == mNameColumnIndex)
{
@@ -228,7 +228,7 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask)
LLCoordGL pos( sticky_rect.mRight - info_icon_size, sticky_rect.mTop - (sticky_rect.getHeight() - icon->getHeight())/2 );
// Should we show a group or an avatar inspector?
- bool is_group = hit_item->getValue()["is_group"].asBoolean();
+ bool is_group = hit_item->isGroup();
LLToolTip::Params params;
params.background_visible( false );
@@ -271,10 +271,10 @@ void LLNameListCtrl::addGroupNameItem(LLNameListCtrl::NameItem& item, EAddPositi
addNameItemRow(item, pos);
}
-void LLNameListCtrl::addNameItem(LLNameListCtrl::NameItem& item, EAddPosition pos)
+LLScrollListItem* LLNameListCtrl::addNameItem(LLNameListCtrl::NameItem& item, EAddPosition pos)
{
item.target = INDIVIDUAL;
- addNameItemRow(item, pos);
+ return addNameItemRow(item, pos);
}
LLScrollListItem* LLNameListCtrl::addElement(const LLSD& element, EAddPosition pos, void* userdata)
@@ -293,19 +293,12 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(
const std::string& suffix)
{
LLUUID id = name_item.value().asUUID();
- 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 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);
- }
+ LLNameListItem* item = new LLNameListItem(name_item,name_item.target() == GROUP);
if (!item) return NULL;
+ LLScrollListCtrl::addRow(item, name_item, pos);
+
// use supplied name by default
std::string fullname = name_item.name;
switch(name_item.target)
@@ -411,7 +404,7 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
setNeedsSort();
}
}
-
+
dirtyColumns();
}