summaryrefslogtreecommitdiff
path: root/indra/newview/llavatarlistitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llavatarlistitem.cpp')
-rw-r--r--indra/newview/llavatarlistitem.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp
index 3bee5c353f..59ed391c06 100644
--- a/indra/newview/llavatarlistitem.cpp
+++ b/indra/newview/llavatarlistitem.cpp
@@ -42,7 +42,7 @@
#include "llavatariconctrl.h"
#include "llbutton.h"
-LLAvatarListItem::LLAvatarListItem()
+LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
: LLPanel(),
mAvatarIcon(NULL),
mAvatarName(NULL),
@@ -55,14 +55,12 @@ LLAvatarListItem::LLAvatarListItem()
mShowInfoBtn(true),
mShowProfileBtn(true)
{
- LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_list_item.xml");
- // Remember avatar icon width including its padding from the name text box,
- // so that we can hide and show the icon again later.
-
- mIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft;
- mInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight;
- mProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight;
- mSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight;
+ if (not_from_ui_factory)
+ {
+ LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_list_item.xml");
+ }
+ // *NOTE: mantipov: do not use any member here. They can be uninitialized here in case instance
+ // is created from the UICtrlFactory
}
LLAvatarListItem::~LLAvatarListItem()
@@ -87,6 +85,13 @@ BOOL LLAvatarListItem::postBuild()
mProfileBtn->setVisible(false);
mProfileBtn->setClickedCallback(boost::bind(&LLAvatarListItem::onProfileBtnClick, this));
+ // Remember avatar icon width including its padding from the name text box,
+ // so that we can hide and show the icon again later.
+ mIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft;
+ mInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight;
+ mProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight;
+ mSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight;
+
/*
if(!p.buttons.profile)
{