From c494c75f52fe8af3641eb83f5451d73327cfdb1e Mon Sep 17 00:00:00 2001 From: "sspitzer@mozilla.org" Date: Sun, 9 Sep 2007 11:18:58 -0700 Subject: [PATCH] fix for bug #395541: when searching previous autocomplete results, if we find any, tell the front end immediately, instead of waiting for our first db query to return r=dietrich, a=mconnor for m8 --- toolkit/components/places/src/nsNavHistoryAutoComplete.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/toolkit/components/places/src/nsNavHistoryAutoComplete.cpp b/toolkit/components/places/src/nsNavHistoryAutoComplete.cpp index 9f8b90ddcdc..388981d770c 100644 --- a/toolkit/components/places/src/nsNavHistoryAutoComplete.cpp +++ b/toolkit/components/places/src/nsNavHistoryAutoComplete.cpp @@ -362,8 +362,14 @@ nsNavHistory::StartSearch(const nsAString & aSearchString, mCurrentResult->GetMatchCount(&count); if (count > 0) { + // when searching previous autocomplete results, + // if we found any matches, tell the front end immediately, + // instead of waiting until our first query returns. mCurrentResult->SetSearchResult(nsIAutoCompleteResult::RESULT_SUCCESS_ONGOING); mCurrentResult->SetDefaultIndex(0); + rv = mCurrentResult->SetListener(this); + NS_ENSURE_SUCCESS(rv, rv); + mCurrentListener->OnSearchResult(this, mCurrentResult); } } else if (!mCurrentSearchString.IsEmpty()) {