diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2023-10-12 22:26:42 +0200 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2023-10-12 22:40:37 +0200 |
commit | 94e2b107628cb10d34bb92e491d67d15c8a989c3 (patch) | |
tree | 544af30d65ca024d22e601b9754161fb4c9ec49b /indra | |
parent | abcf1a7924067b7d930397603144932e1cda004a (diff) |
SL-20286 Duplication of autocomplete results occurs when entering some search queries in the navigation bar
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lllocationinputctrl.cpp | 17 | ||||
-rw-r--r-- | indra/newview/lllocationinputctrl.h | 1 |
2 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index d84b6990b9..9925a552ce 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -705,7 +705,7 @@ void LLLocationInputCtrl::onLocationPrearrange(const LLSD& data) value["item_type"] = LANDMARK; value["AssetUUID"] = landmark_items[i]->getAssetUUID(); - add(landmark_items[i]->getName(), value); + addLocationHistoryEntry(landmark_items[i]->getName(), value); } //Let's add teleport history items @@ -730,7 +730,7 @@ void LLLocationInputCtrl::onLocationPrearrange(const LLSD& data) std::string region_name = result->mTitle.substr(0, result->mTitle.find(',')); //TODO*: add Surl to teleportitem or parse region name from title value["tooltip"] = LLSLURL(region_name, result->mGlobalPos).getSLURLString(); - add(result->getTitle(), value); + addLocationHistoryEntry(result->getTitle(), value); } result = std::find_if(result + 1, th_items.end(), boost::bind( &LLLocationInputCtrl::findTeleportItemsByTitle, this, @@ -983,6 +983,17 @@ void LLLocationInputCtrl::positionMaturityButton() mMaturityButton->setVisible(rect.mRight < mTextEntry->getRect().getWidth() - right_pad); } +void LLLocationInputCtrl::addLocationHistoryEntry(const std::string& title, const LLSD& value) +{ + // SL-20286 : Duplication of autocomplete results occurs when entering some search queries in the navigation bar + // Exclude visual duplicates (items with the same titles) in the dropdown list + LLScrollListItem* item = mList->getItemByLabel(title); + if (!item) + { + add(title, value); + } +} + void LLLocationInputCtrl::rebuildLocationHistory(const std::string& filter) { LLLocationHistory::location_list_t filtered_items; @@ -1007,7 +1018,7 @@ void LLLocationInputCtrl::rebuildLocationHistory(const std::string& filter) //location history can contain only typed locations value["item_type"] = TYPED_REGION_SLURL; value["global_pos"] = it->mGlobalPos.getValue(); - add(it->getLocation(), value); + addLocationHistoryEntry(it->getLocation(), value); } } diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index af2a9f6afd..cbc05602ce 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -145,6 +145,7 @@ private: void refreshMaturityButton(); void positionMaturityButton(); + void addLocationHistoryEntry(const std::string& title, const LLSD& value); void rebuildLocationHistory(const std::string& filter = LLStringUtil::null); bool findTeleportItemsByTitle(const LLTeleportHistoryItem& item, const std::string& filter); void setText(const LLStringExplicit& text); |