mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 21:55:31 +00:00
Fix to account for the fact that nsISupportsArray returns PRBools for some inteface methods. r=akkana, jfrancis.
This commit is contained in:
parent
e1407e1b4b
commit
19c94639fb
@ -1725,7 +1725,7 @@ nsRangeList::AddSelectionListener(nsIDOMSelectionListener* inNewListener)
|
||||
nsresult result;
|
||||
nsCOMPtr<nsISupports> isupports = do_QueryInterface(inNewListener , &result);
|
||||
if (NS_SUCCEEDED(result))
|
||||
result = mSelectionListeners->AppendElement(isupports); // addrefs
|
||||
result = mSelectionListeners->AppendElement(isupports) ? NS_OK : NS_ERROR_FAILURE; // addrefs
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1739,7 +1739,7 @@ nsRangeList::RemoveSelectionListener(nsIDOMSelectionListener* inListenerToRemove
|
||||
if (!inListenerToRemove )
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
nsCOMPtr<nsISupports> isupports = do_QueryInterface(inListenerToRemove);
|
||||
return mSelectionListeners->RemoveElement(isupports); // releases
|
||||
return mSelectionListeners->RemoveElement(isupports) ? NS_OK : NS_ERROR_FAILURE; // releases
|
||||
}
|
||||
|
||||
|
||||
@ -1784,9 +1784,8 @@ nsRangeList::NotifySelectionListeners()
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
for (PRUint32 i = 0; i < cnt;i++)
|
||||
{
|
||||
nsCOMPtr<nsIDOMSelectionListener> thisListener;
|
||||
nsCOMPtr<nsISupports> isupports(dont_AddRef(mSelectionListeners->ElementAt(i)));
|
||||
thisListener = do_QueryInterface(isupports);
|
||||
nsCOMPtr<nsIDOMSelectionListener> thisListener = do_QueryInterface(isupports);
|
||||
if (thisListener)
|
||||
thisListener->NotifySelectionChanged();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user