fix for bug #393244: occasionally hitting enter in the url bar will not have an effect

r=gavin
This commit is contained in:
sspitzer%mozilla.org 2007-08-24 18:40:45 +00:00
Родитель 5c965d263b
Коммит c3e297cbb1
1 изменённых файлов: 13 добавлений и 12 удалений

Просмотреть файл

@ -183,7 +183,6 @@ nsAutoCompleteController::StartSearch(const nsAString &aSearchString)
{
mSearchString = aSearchString;
StartSearchTimer();
return NS_OK;
}
@ -1029,7 +1028,11 @@ nsAutoCompleteController::StopSearch()
mSearches->GetElementAt(i, getter_AddRefs(search));
search->StopSearch();
}
}
mSearchesOngoing = 0;
// since we were searching, but now we've stopped,
// we need to call PostSearchCleanup()
PostSearchCleanup();
}
return NS_OK;
}
@ -1227,17 +1230,15 @@ nsAutoCompleteController::ProcessResult(PRInt32 aSearchIndex, nsIAutoCompleteRes
else
ClosePopup();
// if the user hit enter but we still have searches ongoing,
// stop the searches, otherwise enter won't be handled
// by PostSearchCleanup() until the ongoing searches finish.
if (mEnterAfterSearch && mSearchesOngoing) {
StopSearch();
mSearchesOngoing = 0;
}
// If this is the last search to return, cleanup
if (mSearchesOngoing == 0)
if (mSearchesOngoing == 0) {
// If this is the last search to return, cleanup
PostSearchCleanup();
}
else if (mEnterAfterSearch) {
// since we still have searches ongoing (mSearchesOngoing != 0)
// and the user has hit enter, stop the searches
StopSearch();
}
return NS_OK;
}