summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterworldmap.cpp
diff options
context:
space:
mode:
authorDave SIMmONs <simon@lindenlab.com>2011-05-02 09:05:56 -0700
committerDave SIMmONs <simon@lindenlab.com>2011-05-02 09:05:56 -0700
commitf393774caf49313f24d33cb2b33b6ad92c70977f (patch)
treeebdaf44b4c3152362f3e9b18c227bd09d39031d5 /indra/newview/llfloaterworldmap.cpp
parent31e16be0daa10e6d66b133c308130524a7a0d881 (diff)
parentb9bb792c478d703c6442351ecb563c0a67f77111 (diff)
Merge from lindenlab/viewer-development
Diffstat (limited to 'indra/newview/llfloaterworldmap.cpp')
-rwxr-xr-xindra/newview/llfloaterworldmap.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 03cf0332a9..f8a4ce7ad0 100755
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -73,6 +73,7 @@
#include "llslider.h"
#include "message.h"
#include "llwindow.h" // copyTextToClipboard()
+#include <algorithm>
//---------------------------------------------------------------------------
// Constants
@@ -85,6 +86,16 @@ static const F32 MAP_ZOOM_TIME = 0.2f;
// Currently (01/26/09), this value allows the whole grid to be visible in a 1024x1024 window.
static const S32 MAX_VISIBLE_REGIONS = 512;
+// It would be more logical to have this inside the method where it is used but to compile under gcc this
+// struct has to be here.
+struct SortRegionNames
+{
+ inline bool operator ()(std::pair <U64, LLSimInfo*> const& _left, std::pair <U64, LLSimInfo*> const& _right)
+ {
+ return(LLStringUtil::compareInsensitive(_left.second->getName(), _right.second->getName()) < 0);
+ }
+};
+
enum EPanDirection
{
PAN_UP,
@@ -1483,10 +1494,13 @@ 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*> > sim_info_vec(LLWorldMap::getInstance()->getRegionMap().begin(), LLWorldMap::getInstance()->getRegionMap().end());
+ std::sort(sim_info_vec.begin(), sim_info_vec.end(), SortRegionNames());
+
+ for (std::vector<std::pair <U64, LLSimInfo*> >::const_iterator it = sim_info_vec.begin(); it != sim_info_vec.end(); ++it)
{
LLSimInfo* info = it->second;
std::string sim_name_lower = info->getName();