Bug 30088. Type ahead find extension, fixing timeouts so that are reset on failed matches as well. Not part of build

This commit is contained in:
aaronl%netscape.com 2002-07-10 07:39:35 +00:00
Родитель f41032f4eb
Коммит f7b52a47ea
1 изменённых файлов: 9 добавлений и 7 удалений

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

@ -564,6 +564,15 @@ NS_IMETHODIMP nsTypeAheadFind::KeyPress(nsIDOMEvent* aEvent)
gIsFindingText = PR_TRUE; // prevents listener callbacks from resetting us during typeahead find processing gIsFindingText = PR_TRUE; // prevents listener callbacks from resetting us during typeahead find processing
nsresult rv = FindItNow(isLinksOnly, isFirstVisiblePreferred, isBackspace); nsresult rv = FindItNow(isLinksOnly, isFirstVisiblePreferred, isBackspace);
// ------- If accessibility.typeaheadfind.timeout is set, cancel find after specified # milliseconds
if (mTimeoutLength) {
if (!mTimer)
mTimer = do_CreateInstance("@mozilla.org/timer;1");
if (mTimer)
mTimer->Init(NS_STATIC_CAST(nsITimerCallback*, this), mTimeoutLength);
}
gIsFindingText = PR_FALSE; gIsFindingText = PR_FALSE;
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
@ -590,13 +599,6 @@ NS_IMETHODIMP nsTypeAheadFind::KeyPress(nsIDOMEvent* aEvent)
mFindService->SetFindBackwards(PR_FALSE); mFindService->SetFindBackwards(PR_FALSE);
} }
// ------- If accessibility.typeaheadfind.timeout is set, cancel find after specified # milliseconds
if (mTimeoutLength) {
if (!mTimer)
mTimer = do_CreateInstance("@mozilla.org/timer;1");
if (mTimer)
mTimer->Init(NS_STATIC_CAST(nsITimerCallback*, this), mTimeoutLength);
}
if (mTypeAheadBuffer.Length() == 1) { // If first letter, store where the first find succeeded (mStartFindRange) if (mTypeAheadBuffer.Length() == 1) { // If first letter, store where the first find succeeded (mStartFindRange)
mStartFindRange = nsnull; mStartFindRange = nsnull;
nsCOMPtr<nsIDOMRange> startFindRange; nsCOMPtr<nsIDOMRange> startFindRange;