Bug 1338086 - Remove useless else blocks in order to reduce complexity in toolkit/components/typeaheadfind r?mstange
MozReview-Commit-ID: IdbRm6QFZb8
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -220,32 +220,32 @@ nsTypeAheadFind::ReleaseStrongMemberVari
mSelectionController = nullptr;
mFind = nullptr;
}
NS_IMETHODIMP
nsTypeAheadFind::SetSelectionModeAndRepaint(int16_t aToggle)
{
- nsCOMPtr<nsISelectionController> selectionController =
+ nsCOMPtr<nsISelectionController> selectionController =
do_QueryReferent(mSelectionController);
if (!selectionController) {
return NS_OK;
}
selectionController->SetDisplaySelection(aToggle);
selectionController->RepaintSelection(nsISelectionController::SELECTION_NORMAL);
return NS_OK;
}
NS_IMETHODIMP
nsTypeAheadFind::CollapseSelection()
{
- nsCOMPtr<nsISelectionController> selectionController =
+ nsCOMPtr<nsISelectionController> selectionController =
do_QueryReferent(mSelectionController);
if (!selectionController) {
return NS_OK;
}
nsCOMPtr<nsISelection> selection;
selectionController->GetSelection(nsISelectionController::SELECTION_NORMAL,
getter_AddRefs(selection));
@@ -256,30 +256,31 @@ nsTypeAheadFind::CollapseSelection()
}
NS_IMETHODIMP
nsTypeAheadFind::Observe(nsISupports *aSubject, const char *aTopic,
const char16_t *aData)
{
if (!nsCRT::strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
return PrefsReset();
- } else if (!nsCRT::strcmp(aTopic, DOM_WINDOW_DESTROYED_TOPIC) &&
+ }
+ if (!nsCRT::strcmp(aTopic, DOM_WINDOW_DESTROYED_TOPIC) &&
SameCOMIdentity(aSubject, mCurrentWindow)) {
ReleaseStrongMemberVariables();
}
return NS_OK;
}
void
nsTypeAheadFind::SaveFind()
{
if (mWebBrowserFind)
mWebBrowserFind->SetSearchString(mTypeAheadBuffer.get());
-
+
// save the length of this find for "not found" sound
mLastFindLength = mTypeAheadBuffer.Length();
}
void
nsTypeAheadFind::PlayNotFoundSound()
{
if (mNotFoundSoundURL.IsEmpty()) // no sound