From 76db5e4c7d1e243164b249e3cf7792d0873a8b6a Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 18 Sep 2010 03:36:39 -0700 Subject: Fixed contacts search not working on uppercase names --- linden/indra/newview/llfloaterfriends.cpp | 13 +++++++------ linden/indra/newview/llfloaterfriends.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/llfloaterfriends.cpp b/linden/indra/newview/llfloaterfriends.cpp index 67d9626..e2d3f7c 100644 --- a/linden/indra/newview/llfloaterfriends.cpp +++ b/linden/indra/newview/llfloaterfriends.cpp @@ -429,7 +429,7 @@ struct SortFriendsByID } }; -void LLPanelFriends::refreshNames(U32 changed_mask, const std::string& filter_string) +void LLPanelFriends::refreshNames(U32 changed_mask, const std::string& search_string) { LLDynamicArray selected_ids = getSelectedIDs(); S32 pos = mFriendsList->getScrollPos(); @@ -441,7 +441,7 @@ void LLPanelFriends::refreshNames(U32 changed_mask, const std::string& filter_st BOOL have_names = TRUE; // I hate doing it this way. There's no need for it. I blame LL -- MC - if (filter_string.empty()) + if (search_string.empty()) { if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE)) { @@ -457,7 +457,8 @@ void LLPanelFriends::refreshNames(U32 changed_mask, const std::string& filter_st { std::string firstname; std::string lastname; - utf8str_tolower(filter_string); + std::string filter = search_string; + LLStringUtil::toLower(filter); LLAvatarTracker::buddy_map_t temp_buddies; for (LLAvatarTracker::buddy_map_t::reverse_iterator bIt = all_buddies.rbegin(); @@ -467,10 +468,10 @@ void LLPanelFriends::refreshNames(U32 changed_mask, const std::string& filter_st if (gCacheName->getName((*bIt).first, firstname, lastname)) { std::string test_name(firstname + " " + lastname); - if ((utf8str_tolower(test_name)).find(filter_string) != std::string::npos) + LLStringUtil::toLower(test_name); + if (test_name.find(filter) != std::string::npos) { - llinfos << "inserting: " << test_name << " from filter: " << filter_string << llendl; - temp_buddies.insert(temp_buddies.begin(), *bIt); + temp_buddies.insert(temp_buddies.begin(), std::pair((*bIt).first, (*bIt).second)); } } } diff --git a/linden/indra/newview/llfloaterfriends.h b/linden/indra/newview/llfloaterfriends.h index 8206362..d2317b7 100644 --- a/linden/indra/newview/llfloaterfriends.h +++ b/linden/indra/newview/llfloaterfriends.h @@ -100,7 +100,7 @@ private: // protected members typedef std::map rights_map_t; - void refreshNames(U32 changed_mask, const std::string& filter_string); + void refreshNames(U32 changed_mask, const std::string& search_string); void filterContacts(const std::string& search_string); BOOL refreshNamesSync(const LLAvatarTracker::buddy_map_t & all_buddies); -- cgit v1.1