From c7c93df2d134da808400d94e4cf81d514a0155c3 Mon Sep 17 00:00:00 2001 From: Arrehn Date: Sat, 11 Jun 2011 13:07:39 -0400 Subject: [PATCH] FIRE-754: Do the right thing on world map search results, by Ansariel Hiller --- indra/newview/llfloaterworldmap.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index eaeac9cb73..d5c812630d 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -1542,17 +1542,24 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) mCompletingRegionName = ""; } - // if match found, highlight it and go - if (!match.isUndefined()) + if (num_results > 0) { - list->selectByValue(match); + // if match found, highlight it and go + if (!match.isUndefined()) + { + list->selectByValue(match); + } + // else select first found item + else + { + list->selectFirstItem(); + } getChild("search_results")->setFocus(TRUE); onCommitSearchResult(); } - - // if we found nothing, say "none" - if (num_results == 0) + else { + // if we found nothing, say "none" list->setCommentText(LLTrans::getString("worldmap_results_none_found")); list->operateOnAll(LLCtrlListInterface::OP_DESELECT); }