summaryrefslogtreecommitdiff
path: root/indra/newview/llagentui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagentui.cpp')
-rw-r--r--indra/newview/llagentui.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp
index 72ab9235cf..15d9f36b74 100644
--- a/indra/newview/llagentui.cpp
+++ b/indra/newview/llagentui.cpp
@@ -49,12 +49,10 @@
void LLAgentUI::buildName(std::string& name)
{
name.clear();
-
- LLVOAvatarSelf* avatar_object = gAgent.getAvatarObject();
- if (avatar_object)
+ if (isAgentAvatarValid())
{
- LLNameValue *first_nv = avatar_object->getNVPair("FirstName");
- LLNameValue *last_nv = avatar_object->getNVPair("LastName");
+ LLNameValue *first_nv = gAgentAvatarp->getNVPair("FirstName");
+ LLNameValue *last_nv = gAgentAvatarp->getNVPair("LastName");
if (first_nv && last_nv)
{
name = first_nv->printData() + " " + last_nv->printData();
@@ -73,20 +71,20 @@ void LLAgentUI::buildName(std::string& name)
//static
void LLAgentUI::buildFullname(std::string& name)
{
- if (gAgent.getAvatarObject()) name = gAgent.getAvatarObject()->getFullname();
+ if (isAgentAvatarValid())
+ name = gAgentAvatarp->getFullname();
}
//static
-std::string LLAgentUI::buildSLURL(const bool escaped /*= true*/)
+void LLAgentUI::buildSLURL(LLSLURL& slurl, const bool escaped /*= true*/)
{
- std::string slurl;
- LLViewerRegion *regionp = gAgent.getRegion();
- if (regionp)
- {
- LLVector3d agentPos = gAgent.getPositionGlobal();
- slurl = LLSLURL::buildSLURLfromPosGlobal(regionp->getName(), agentPos, escaped);
- }
- return slurl;
+ LLSLURL return_slurl;
+ LLViewerRegion *regionp = gAgent.getRegion();
+ if (regionp)
+ {
+ return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionGlobal());
+ }
+ slurl = return_slurl;
}
//static