bug #75504; sr=jband. simple fixes correcting where people inappropriately applied |getter_AddRefs|

This commit is contained in:
scc%mozilla.org 2001-05-03 10:09:59 +00:00
Родитель 2bbd5e07b9
Коммит 6860a0a739
15 изменённых файлов: 19 добавлений и 22 удалений

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

@ -221,7 +221,7 @@ NS_IMETHODIMP nsGenericAccessible::GetAccExtState(PRUint32 *_retval)
nsDOMAccessible::nsDOMAccessible(nsIPresShell* aShell, nsIDOMNode* aNode) nsDOMAccessible::nsDOMAccessible(nsIPresShell* aShell, nsIDOMNode* aNode)
{ {
mPresShell = getter_AddRefs(NS_GetWeakReference(aShell)); mPresShell = do_GetWeakReference(aShell);
mNode = aNode; mNode = aNode;
} }

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

@ -64,7 +64,7 @@ class nsDOMAccessible : public nsGenericAccessible
NS_IMETHOD AccRemoveSelection(void); NS_IMETHOD AccRemoveSelection(void);
protected: protected:
nsIWeakReference* mPresShell; nsCOMPtr<nsIWeakReference> mPresShell;
nsCOMPtr<nsIDOMNode> mNode; nsCOMPtr<nsIDOMNode> mNode;
}; };

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

@ -221,7 +221,7 @@ NS_IMETHODIMP nsGenericAccessible::GetAccExtState(PRUint32 *_retval)
nsDOMAccessible::nsDOMAccessible(nsIPresShell* aShell, nsIDOMNode* aNode) nsDOMAccessible::nsDOMAccessible(nsIPresShell* aShell, nsIDOMNode* aNode)
{ {
mPresShell = getter_AddRefs(NS_GetWeakReference(aShell)); mPresShell = do_GetWeakReference(aShell);
mNode = aNode; mNode = aNode;
} }

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

@ -64,7 +64,7 @@ class nsDOMAccessible : public nsGenericAccessible
NS_IMETHOD AccRemoveSelection(void); NS_IMETHOD AccRemoveSelection(void);
protected: protected:
nsIWeakReference* mPresShell; nsCOMPtr<nsIWeakReference> mPresShell;
nsCOMPtr<nsIDOMNode> mNode; nsCOMPtr<nsIDOMNode> mNode;
}; };

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

@ -155,7 +155,7 @@ nsXULControllers::RemoveControllerAt(PRUint32 index, nsIController **_retval)
PRBool removed = mControllers.RemoveElementAt(index); PRBool removed = mControllers.RemoveElementAt(index);
NS_ASSERTION(removed, "Removal of controller failed"); NS_ASSERTION(removed, "Removal of controller failed");
controllerData->GetController(getter_AddRefs(_retval)); controllerData->GetController(_retval);
delete controllerData; delete controllerData;
return NS_OK; return NS_OK;

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

@ -4740,7 +4740,7 @@ nsDocShell::GetPromptAndStringBundle(nsIPrompt ** aPrompt,
NS_ENSURE_SUCCESS(stringBundleService-> NS_ENSURE_SUCCESS(stringBundleService->
CreateBundle(DIALOG_STRING_URI, CreateBundle(DIALOG_STRING_URI,
getter_AddRefs(aStringBundle)), aStringBundle),
NS_ERROR_FAILURE); NS_ERROR_FAILURE);
return NS_OK; return NS_OK;

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

@ -1244,7 +1244,7 @@ nsWebShell::GetControllerForCommand ( const nsAReadableString & inCommand, nsICo
nsCOMPtr<nsIFocusController> focusController; nsCOMPtr<nsIFocusController> focusController;
rv = window->GetRootFocusController ( getter_AddRefs(focusController) ); rv = window->GetRootFocusController ( getter_AddRefs(focusController) );
if ( focusController ) if ( focusController )
rv = focusController->GetControllerForCommand ( inCommand, getter_AddRefs(outController) ); rv = focusController->GetControllerForCommand ( inCommand, outController );
} // if window } // if window
return rv; return rv;

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

@ -2881,7 +2881,7 @@ GlobalWindowImpl::GetRootFocusController(nsIFocusController** aController)
if (chromeHandler) { if (chromeHandler) {
nsCOMPtr<nsPIWindowRoot> windowRoot(do_QueryInterface(chromeHandler)); nsCOMPtr<nsPIWindowRoot> windowRoot(do_QueryInterface(chromeHandler));
if (windowRoot) { if (windowRoot) {
windowRoot->GetFocusController(getter_AddRefs(aController)); windowRoot->GetFocusController(aController);
} }
} }
} }

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

@ -726,7 +726,7 @@ nsAbSync::OpenAB(char *aAbName, nsIAddrDatabase **aDatabase)
NS_WITH_SERVICE(nsIAddrDatabase, addrDBFactory, kAddressBookDBCID, &rv); NS_WITH_SERVICE(nsIAddrDatabase, addrDBFactory, kAddressBookDBCID, &rv);
if (NS_SUCCEEDED(rv) && addrDBFactory) if (NS_SUCCEEDED(rv) && addrDBFactory)
rv = addrDBFactory->Open(dbPath, PR_TRUE, getter_AddRefs(aDatabase), PR_TRUE); rv = addrDBFactory->Open(dbPath, PR_TRUE, aDatabase, PR_TRUE);
} }
else else
rv = NS_ERROR_FAILURE; rv = NS_ERROR_FAILURE;

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

@ -629,8 +629,7 @@ NS_IMETHODIMP nsAbMDBDirectory::AddMailList(nsIAbDirectory *list)
{ {
nsAbMDBDirProperty* dblistproperty = new nsAbMDBDirProperty (); nsAbMDBDirProperty* dblistproperty = new nsAbMDBDirProperty ();
NS_ADDREF(dblistproperty); NS_ADDREF(dblistproperty);
nsCOMPtr<nsIAbDirectory> newlist; nsCOMPtr<nsIAbDirectory> newlist = getter_AddRefs(NS_STATIC_CAST(nsIAbDirectory*, dblistproperty));
newlist = getter_AddRefs(dblistproperty);
newlist->CopyMailList(list); newlist->CopyMailList(list);
list = newlist; list = newlist;
dblist = do_QueryInterface(list); dblist = do_QueryInterface(list);
@ -675,8 +674,7 @@ NS_IMETHODIMP nsAbMDBDirectory::AddCard(nsIAbCard* card, nsIAbCard **_retval)
{ {
nsAbMDBCardProperty* dbcardproperty = new nsAbMDBCardProperty (); nsAbMDBCardProperty* dbcardproperty = new nsAbMDBCardProperty ();
NS_ADDREF(dbcardproperty); NS_ADDREF(dbcardproperty);
nsCOMPtr<nsIAbCard> newcard; nsCOMPtr<nsIAbCard> newcard = getter_AddRefs(NS_STATIC_CAST(nsIAbCard*, dbcardproperty));
newcard = getter_AddRefs(dbcardproperty);
newcard->Copy (card); newcard->Copy (card);
card = newcard; card = newcard;
dbcard = do_QueryInterface(card); dbcard = do_QueryInterface(card);
@ -735,8 +733,7 @@ NS_IMETHODIMP nsAbMDBDirectory::DropCard(nsIAbCard* card, nsIAbCard **_retval)
{ {
nsAbMDBCardProperty* dbcardproperty = new nsAbMDBCardProperty (); nsAbMDBCardProperty* dbcardproperty = new nsAbMDBCardProperty ();
NS_ADDREF(dbcardproperty); NS_ADDREF(dbcardproperty);
nsCOMPtr<nsIAbCard> newcard; nsCOMPtr<nsIAbCard> newcard = getter_AddRefs (NS_STATIC_CAST(nsIAbCard*, dbcardproperty));
newcard = getter_AddRefs (dbcardproperty);
newcard->Copy (card); newcard->Copy (card);
card = newcard; card = newcard;
dbcard = do_QueryInterface (card); dbcard = do_QueryInterface (card);

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

@ -261,7 +261,7 @@ nsAddbookProtocolHandler::OpenAB(char *aAbName, nsIAddrDatabase **aDatabase)
NS_WITH_SERVICE(nsIAddrDatabase, addrDBFactory, kAddressBookDBCID, &rv); NS_WITH_SERVICE(nsIAddrDatabase, addrDBFactory, kAddressBookDBCID, &rv);
if (NS_SUCCEEDED(rv) && addrDBFactory) if (NS_SUCCEEDED(rv) && addrDBFactory)
rv = addrDBFactory->Open(dbPath, PR_TRUE, getter_AddRefs(aDatabase), PR_TRUE); rv = addrDBFactory->Open(dbPath, PR_TRUE, aDatabase, PR_TRUE);
delete dbPath; delete dbPath;
} }

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

@ -589,7 +589,7 @@ NS_AsyncWriteFromStream(nsIRequest **aRequest,
aOffset, aOffset,
aCount, aCount,
aFlags, aFlags,
getter_AddRefs(aRequest)); aRequest);
} }
// //
@ -619,7 +619,7 @@ NS_AsyncReadToStream(nsIRequest **aRequest,
aOffset, aOffset,
aCount, aCount,
aFlags, aFlags,
getter_AddRefs(aRequest)); aRequest);
} }
#endif // nsNetUtil_h__ #endif // nsNetUtil_h__

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

@ -176,7 +176,7 @@ nsSHistory::GetEntryAtIndex(PRInt32 aIndex, PRBool aModifyIndex, nsISHEntry** aR
rv = GetTransactionAtIndex(aIndex, getter_AddRefs(txn)); rv = GetTransactionAtIndex(aIndex, getter_AddRefs(txn));
if (NS_SUCCEEDED(rv) && txn) { if (NS_SUCCEEDED(rv) && txn) {
//Get the Entry from the transaction //Get the Entry from the transaction
rv = txn->GetSHEntry(getter_AddRefs(aResult)); rv = txn->GetSHEntry(aResult);
if (NS_SUCCEEDED(rv) && (*aResult)) { if (NS_SUCCEEDED(rv) && (*aResult)) {
// Set mIndex to the requested index, if asked to do so.. // Set mIndex to the requested index, if asked to do so..
if (aModifyIndex) { if (aModifyIndex) {

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

@ -2660,7 +2660,7 @@ nsInstall::ExtractFileFromJar(const nsString& aJarfile, nsIFile* aSuggestedName,
} }
#endif #endif
extractHereSpec->Clone(getter_AddRefs(aRealName)); extractHereSpec->Clone(aRealName);
return nsInstall::SUCCESS; return nsInstall::SUCCESS;
} }

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

@ -553,7 +553,7 @@ nsInstallPatch::NativePatch(nsIFile *sourceFile, nsIFile *patchFile, nsIFile **n
if (status == GDIFF_ERR_CHECKSUM) if (status == GDIFF_ERR_CHECKSUM)
status = GDIFF_ERR_CHECKSUM_RESULT; status = GDIFF_ERR_CHECKSUM_RESULT;
rv = outFileSpec->Clone(getter_AddRefs(newFile)); rv = outFileSpec->Clone(newFile);
} }
else else
{ {
@ -616,7 +616,7 @@ nsInstallPatch::NativePatch(nsIFile *sourceFile, nsIFile *patchFile, nsIFile **n
anotherName->GetLeafName(&leaf); anotherName->GetLeafName(&leaf);
anotherName->CopyTo(parent, leaf); anotherName->CopyTo(parent, leaf);
anotherName->Clone(getter_AddRefs(newFile)); anotherName->Clone(newFile);
} }