Bug 406487: be sure to reset mTree when changing autocomplete inputs, so that we properly set the selection when adusting the results, r=enndeakin
authorgavin@gavinsharp.com
Tue, 04 Mar 2008 12:41:57 -0800
changeset 12564 4fc6e0ba78331ef31de027ec66e3f684495b8491
parent 12563 4bc773c63aa95789a0ee516fade1ddd9f2ef06c2
child 12565 2a37d418d34d875edc398a36b8c94dbd194ffd42
push idunknown
push userunknown
push dateunknown
reviewersenndeakin
bugs406487
milestone1.9b5pre
Bug 406487: be sure to reset mTree when changing autocomplete inputs, so that we properly set the selection when adusting the results, r=enndeakin
toolkit/components/autocomplete/src/nsAutoCompleteController.cpp
--- a/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp
+++ b/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp
@@ -132,16 +132,19 @@ nsAutoCompleteController::SetInput(nsIAu
 
   // Nothing more to do if the input was just being set to null.
   if (!aInput)
     return NS_OK;
 
   nsAutoString newValue;
   mInput->GetTextValue(newValue);
   
+  // Clear out this reference in case the new input's popup has no tree
+  mTree = nsnull;
+  
   // Reset all search state members to default values
   mSearchString = newValue;
   mEnterAfterSearch = 0;
   mDefaultIndexCompleted = PR_FALSE;
   mBackspaced = PR_FALSE;
   mSearchStatus = nsIAutoCompleteController::STATUS_NONE;
   mRowCount = 0;
   mSearchesOngoing = 0;