diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 15:12:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 15:12:12 +0000 |
commit | a7c14e2f29831f4bc5eb18e23e55eb6f7a4e3431 (patch) | |
tree | 54617b4f5f04ee87a2c9e3b97cc88b8626859124 /toolkit/components/autocomplete/nsAutoCompleteController.cpp | |
parent | Releasing progress-linux version 115.7.0esr-1~deb12u1progress7u1. (diff) | |
download | firefox-esr-a7c14e2f29831f4bc5eb18e23e55eb6f7a4e3431.tar.xz firefox-esr-a7c14e2f29831f4bc5eb18e23e55eb6f7a4e3431.zip |
Merging upstream version 115.8.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/autocomplete/nsAutoCompleteController.cpp')
-rw-r--r-- | toolkit/components/autocomplete/nsAutoCompleteController.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/toolkit/components/autocomplete/nsAutoCompleteController.cpp b/toolkit/components/autocomplete/nsAutoCompleteController.cpp index dc9754997b..a10f4ee62f 100644 --- a/toolkit/components/autocomplete/nsAutoCompleteController.cpp +++ b/toolkit/components/autocomplete/nsAutoCompleteController.cpp @@ -499,17 +499,24 @@ nsAutoCompleteController::HandleKeyNavigation(uint32_t aKey, bool* _retval) { } } - nsAutoString oldSearchString; - uint16_t oldResult = 0; - // Open the popup if there has been a previous non-errored search, or // else kick off a new search - if (!mResults.IsEmpty() && - NS_SUCCEEDED(mResults[0]->GetSearchResult(&oldResult)) && - oldResult != nsIAutoCompleteResult::RESULT_FAILURE && - NS_SUCCEEDED(mResults[0]->GetSearchString(oldSearchString)) && - oldSearchString.Equals(mSearchString, - nsCaseInsensitiveStringComparator)) { + bool hadPreviousSearch = false; + for (uint32_t i = 0; i < mResults.Length(); ++i) { + nsAutoString oldSearchString; + uint16_t oldResult = 0; + nsIAutoCompleteResult* oldResultObject = mResults[i]; + if (oldResultObject && + NS_SUCCEEDED(oldResultObject->GetSearchResult(&oldResult)) && + oldResult != nsIAutoCompleteResult::RESULT_FAILURE && + NS_SUCCEEDED(oldResultObject->GetSearchString(oldSearchString)) && + oldSearchString.Equals(mSearchString, + nsCaseInsensitiveStringComparator)) { + hadPreviousSearch = true; + break; + } + } + if (hadPreviousSearch) { if (mMatchCount) { OpenPopup(); } |