summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Yap <none@none>2011-04-13 15:09:44 -0400
committerJonathan Yap <none@none>2011-04-13 15:09:44 -0400
commitefa26485dfa20d138cb654e27cb90e209dd1f395 (patch)
tree8c02b46ddaaeceda695bb286ba658b7ac1f1745b
parentf633aef1af5a1a695df655080d3a20c033a31e18 (diff)
STORM-1128 Sort the results of using search in the World Map
-rw-r--r--doc/contributions.txt2
-rwxr-xr-xindra/newview/llfloaterworldmap.cpp18
2 files changed, 17 insertions, 3 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt
index f59539d94c..8faf18a598 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -414,6 +414,7 @@ Jonathan Yap
STORM-1020
STORM-1064
STORM-1077
+ STORM-1128
Kage Pixel
VWR-11
Ken March
@@ -644,6 +645,7 @@ Robin Cornelius
STORM-422
STORM-960
STORM-1019
+ STORM-1128
VWR-2488
VWR-9557
VWR-10579
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 03cf0332a9..bf5f569e36 100755
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -96,6 +96,14 @@ enum EPanDirection
// Values in pixels per region
static const F32 ZOOM_MAX = 128.f;
+struct SortRegionNames
+{
+ inline bool operator ()(std::pair <U64, LLSimInfo*>& _left, std::pair <U64, LLSimInfo*>& _right)
+ {
+ return(LLStringUtil::compareInsensitive(_left.second->getName(),_right.second->getName()) < 0);
+ }
+};
+
//---------------------------------------------------------------------------
// Globals
//---------------------------------------------------------------------------
@@ -1483,10 +1491,14 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
S32 name_length = mCompletingRegionName.length();
LLSD match;
-
+
S32 num_results = 0;
- std::map<U64, LLSimInfo*>::const_iterator it;
- for (it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it)
+
+ std::vector<std::pair <U64, LLSimInfo*>> simInfoVec(LLWorldMap::getInstance()->getRegionMap().begin(), LLWorldMap::getInstance()->getRegionMap().end());
+ std::sort(simInfoVec.begin(), simInfoVec.end(), SortRegionNames());
+
+ std::vector<std::pair <U64, LLSimInfo*>>::const_iterator it;
+ for (it = simInfoVec.begin(); it != simInfoVec.end(); ++it)
{
LLSimInfo* info = it->second;
std::string sim_name_lower = info->getName();