Replace raw use of nsArrayEnumerator with NS_NewArrayEnumerator(). r=sspitzer, alecf

This commit is contained in:
waterson%netscape.com 2000-04-20 09:15:23 +00:00
Родитель 2964aea322
Коммит 6d53960e44
5 изменённых файлов: 8 добавлений и 46 удалений

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

@ -339,13 +339,7 @@ NS_IMETHODIMP nsMessageViewDataSource::ArcLabelsOut(nsIRDFResource* source,
NS_IF_RELEASE(messageEnumerator);
}
}
nsArrayEnumerator* cursor =
new nsArrayEnumerator(arcs);
if (cursor == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(cursor);
*labels = cursor;
return NS_OK;
return NS_NewArrayEnumerator(labels, arcs);
}
if(mDataSource)
return mDataSource->ArcLabelsOut(source, labels);

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

@ -400,13 +400,9 @@ nsMsgAccountManagerDataSource::GetTargets(nsIRDFResource *source,
nsCOMPtr<nsISupportsArray> nodes;
rv = NS_NewISupportsArray(getter_AddRefs(nodes));
if (NS_FAILED(rv)) return rv;
nsISimpleEnumerator* enumerator =
new nsArrayEnumerator(nodes);
if (!enumerator) return NS_ERROR_OUT_OF_MEMORY;
*_retval = enumerator;
NS_ADDREF(*_retval);
rv = NS_NewArrayEnumerator(_retval, nodes);
if (NS_FAILED(rv)) return rv;
#ifdef DEBUG_amds
nsXPIDLCString source_value;
@ -623,14 +619,9 @@ nsMsgAccountManagerDataSource::ArcLabelsOut(nsIRDFResource *source,
else
rv = getAccountArcs(getter_AddRefs(arcs));
NS_ENSURE_SUCCESS(rv, rv);
nsArrayEnumerator* enumerator =
new nsArrayEnumerator(arcs);
NS_ENSURE_TRUE(enumerator, NS_ERROR_OUT_OF_MEMORY);
*_retval = enumerator;
NS_ADDREF(*_retval);
rv = NS_NewArrayEnumerator(_retval, arcs);
if (NS_FAILED(rv)) return rv;
#ifdef DEBUG_amds_
printf("GetArcLabelsOut(%s): Adding child, settings, and name arclabels\n", value);

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

@ -439,15 +439,7 @@ NS_IMETHODIMP nsMsgFolderDataSource::GetTargets(nsIRDFResource* source,
if(!*targets)
{
//create empty cursor
nsCOMPtr<nsISupportsArray> assertions;
NS_NewISupportsArray(getter_AddRefs(assertions));
nsArrayEnumerator* cursor =
new nsArrayEnumerator(assertions);
if(cursor == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(cursor);
*targets = cursor;
rv = NS_OK;
rv = NS_NewEmptyEnumerator(targets);
}
return rv;

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

@ -447,13 +447,7 @@ NS_IMETHODIMP nsMsgMessageDataSource::GetTargets(nsIRDFResource* source,
if(NS_FAILED(rv))
return rv;
nsArrayEnumerator* cursor =
new nsArrayEnumerator(assertions);
if(cursor == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(cursor);
*targets = cursor;
rv = NS_OK;
rv = NS_NewArrayEnumerator(targets, assertions);
}
return rv;
}

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

@ -210,16 +210,7 @@ nsMsgRDFDataSource::ArcLabelsIn(nsIRDFNode *aNode, nsISimpleEnumerator **_retval
if(NS_FAILED(rv))
return rv;
nsArrayEnumerator* arrayEnumerator =
new nsArrayEnumerator(arcs);
if (arrayEnumerator == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(arrayEnumerator);
*_retval = arrayEnumerator;
return NS_OK;
return NS_NewArrayEnumerator(_retval, arcs);
}