Bug 702410 - mIsOpen is a Redundant Property. r=mak
authorFelix Fung <ffung@mozilla.com>
Fri, 18 Nov 2011 14:37:51 -0800
changeset 80484 9bc499408d36163ab2a61dc194e44c2892d5c1c2
parent 80483 ee570616da4c28d3646a29c73bcbd456adc2c739
child 80485 97654e2b4e73e1d52f93cc6f26fa82a34f0b9e78
push id21500
push userbmo@edmorley.co.uk
push dateSat, 19 Nov 2011 13:04:35 +0000
treeherdermozilla-central@46c2bd7dbdd4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs702410
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 702410 - mIsOpen is a Redundant Property. r=mak
toolkit/components/autocomplete/nsAutoCompleteController.cpp
toolkit/components/autocomplete/nsAutoCompleteController.h
--- a/toolkit/components/autocomplete/nsAutoCompleteController.cpp
+++ b/toolkit/components/autocomplete/nsAutoCompleteController.cpp
@@ -76,17 +76,16 @@ NS_INTERFACE_TABLE_HEAD(nsAutoCompleteCo
 NS_INTERFACE_MAP_END
 
 nsAutoCompleteController::nsAutoCompleteController() :
   mDefaultIndexCompleted(false),
   mBackspaced(false),
   mPopupClosedByCompositionStart(false),
   mIsIMEComposing(false),
   mIgnoreHandleText(false),
-  mIsOpen(false),
   mSearchStatus(nsAutoCompleteController::STATUS_NONE),
   mRowCount(0),
   mSearchesOngoing(0),
   mFirstSearchResult(false)
 {
 }
 
 nsAutoCompleteController::~nsAutoCompleteController()
@@ -126,18 +125,17 @@ nsAutoCompleteController::SetInput(nsIAu
   if (mInput == aInput)
     return NS_OK;
 
   // Clear out the current search context
   if (mInput) {
     // Stop all searches in case they are async.
     StopSearch();
     ClearResults();
-    if (mIsOpen)
-      ClosePopup();
+    ClosePopup();
     mSearches.Clear();
   }
 
   mInput = aInput;
 
   // Nothing more to do if the input was just being set to null.
   if (!aInput)
     return NS_OK;
@@ -967,17 +965,16 @@ nsAutoCompleteController::PerformActionO
 
 nsresult
 nsAutoCompleteController::OpenPopup()
 {
   PRUint32 minResults;
   mInput->GetMinResultsForPopup(&minResults);
 
   if (mRowCount >= minResults) {
-    mIsOpen = true;
     return mInput->SetPopupOpen(true);
   }
 
   return NS_OK;
 }
 
 nsresult
 nsAutoCompleteController::ClosePopup()
@@ -990,17 +987,16 @@ nsAutoCompleteController::ClosePopup()
   mInput->GetPopupOpen(&isOpen);
   if (!isOpen)
     return NS_OK;
 
   nsCOMPtr<nsIAutoCompletePopup> popup;
   mInput->GetPopup(getter_AddRefs(popup));
   NS_ENSURE_TRUE(popup != nsnull, NS_ERROR_FAILURE);
   popup->SetSelectedIndex(-1);
-  mIsOpen = false;
   return mInput->SetPopupOpen(false);
 }
 
 nsresult
 nsAutoCompleteController::StartSearch()
 {
   NS_ENSURE_STATE(mInput);
   nsCOMPtr<nsIAutoCompleteInput> input(mInput);
--- a/toolkit/components/autocomplete/nsAutoCompleteController.h
+++ b/toolkit/components/autocomplete/nsAutoCompleteController.h
@@ -118,16 +118,15 @@ protected:
   nsCOMPtr<nsITreeBoxObject> mTree;
 
   nsString mSearchString;
   bool mDefaultIndexCompleted;
   bool mBackspaced;
   bool mPopupClosedByCompositionStart;
   bool mIsIMEComposing;
   bool mIgnoreHandleText;
-  bool mIsOpen;
   PRUint16 mSearchStatus;
   PRUint32 mRowCount;
   PRUint32 mSearchesOngoing;
   bool mFirstSearchResult;
 };
 
 #endif /* __nsAutoCompleteController__ */