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

This commit is contained in:
sspitzer@mozilla.org 2007-09-09 11:18:58 -07:00
parent 21ad4416c2
commit c494c75f52

View File

@ -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()) {