From 8f04b738d28d54430b4e22e06930b056bdbdf195 Mon Sep 17 00:00:00 2001
From: Mnikolenko ProductEngine <mnikolenko@productengine.com>
Date: Mon, 12 Jan 2015 11:54:24 +0200
Subject: [PATCH] MAINT-2742 FIXED Duplicate Display Names appear once in share
 picker

---
 indra/newview/llcallingcard.cpp         | 8 ++++----
 indra/newview/llcallingcard.h           | 6 +++---
 indra/newview/llfloateravatarpicker.cpp | 4 ++--
 indra/newview/llfloaterworldmap.cpp     | 2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp
index afbb73ee087..b6c5496c17d 100755
--- a/indra/newview/llcallingcard.cpp
+++ b/indra/newview/llcallingcard.cpp
@@ -860,7 +860,7 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship
 {
 	LLAvatarName av_name;
 	LLAvatarNameCache::get( buddy_id, &av_name);
-	buddy_map_t::value_type value(av_name.getDisplayName(), buddy_id);
+	buddy_map_t::value_type value(buddy_id, av_name.getDisplayName());
 	if(buddy->isOnline() && buddy->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION))
 	{
 		mMappable.insert(value);
@@ -871,7 +871,7 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship
 bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy)
 {
 	gCacheName->getFullName(buddy_id, mFullName);
-	buddy_map_t::value_type value(mFullName, buddy_id);
+	buddy_map_t::value_type value(buddy_id, mFullName);
 	if(buddy->isOnline())
 	{
 		mOnline.insert(value);
@@ -883,8 +883,8 @@ bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* bud
 {
 	LLAvatarName av_name;
 	LLAvatarNameCache::get(buddy_id, &av_name);
-	mFullName = av_name.getDisplayName();
-	buddy_map_t::value_type value(mFullName, buddy_id);
+	mFullName = av_name.getCompleteName();
+	buddy_map_t::value_type value(buddy_id, mFullName);
 	if(buddy->isOnline())
 	{
 		mOnline.insert(value);
diff --git a/indra/newview/llcallingcard.h b/indra/newview/llcallingcard.h
index 8803cce59d0..6e5fc01cd85 100755
--- a/indra/newview/llcallingcard.h
+++ b/indra/newview/llcallingcard.h
@@ -233,7 +233,7 @@ class LLCollectMappableBuddies : public LLRelationshipFunctor
 	LLCollectMappableBuddies() {}
 	virtual ~LLCollectMappableBuddies() {}
 	virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy);
-	typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t;
+	typedef std::map<LLUUID, std::string> buddy_map_t;
 	buddy_map_t mMappable;
 	std::string mFullName;
 };
@@ -245,7 +245,7 @@ class LLCollectOnlineBuddies : public LLRelationshipFunctor
 	LLCollectOnlineBuddies() {}
 	virtual ~LLCollectOnlineBuddies() {}
 	virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy);
-	typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t;
+	typedef std::map<LLUUID, std::string> buddy_map_t;
 	buddy_map_t mOnline;
 	std::string mFullName;
 };
@@ -258,7 +258,7 @@ class LLCollectAllBuddies : public LLRelationshipFunctor
 	LLCollectAllBuddies() {}
 	virtual ~LLCollectAllBuddies() {}
 	virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy);
-	typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t;
+	typedef std::map<LLUUID, std::string> buddy_map_t;
 	buddy_map_t mOnline;
 	buddy_map_t mOffline;
 	std::string mFullName;
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index 513c33e60d6..566a3c9cd39 100755
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -348,11 +348,11 @@ void LLFloaterAvatarPicker::populateFriend()
 	
 	for(it = collector.mOnline.begin(); it!=collector.mOnline.end(); it++)
 	{
-		friends_scroller->addStringUUIDItem(it->first, it->second);
+		friends_scroller->addStringUUIDItem(it->second, it->first);
 	}
 	for(it = collector.mOffline.begin(); it!=collector.mOffline.end(); it++)
 	{
-			friends_scroller->addStringUUIDItem(it->first, it->second);
+		friends_scroller->addStringUUIDItem(it->second, it->first);
 	}
 	friends_scroller->sortByColumnIndex(0, TRUE);
 }
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 5093a40ce4a..6837f6159f4 100755
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -891,7 +891,7 @@ void LLFloaterWorldMap::buildAvatarIDList()
 	end = collector.mMappable.end();
 	for( ; it != end; ++it)
 	{
-		list->addSimpleElement((*it).first, ADD_BOTTOM, (*it).second);
+		list->addSimpleElement((*it).second, ADD_BOTTOM, (*it).first);
 	}
 	
 	list->setCurrentByID( LLAvatarTracker::instance().getAvatarID() );
-- 
GitLab