Seamonkey-only bustage from bug 347183 - I'm currently building a tree with this, but it should be right

This commit is contained in:
benjamin%smedbergs.us 2006-08-08 19:05:50 +00:00
Родитель 440b1ab0a4
Коммит e0918f935d
4 изменённых файлов: 18 добавлений и 74 удалений

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

@ -4439,13 +4439,7 @@ nsBookmarksService::GetAllCmds(nsIRDFResource* source,
// always append a separator last (due to aggregation of commands from multiple datasources)
cmdArray->AppendElement(kNC_BookmarkSeparator);
nsISimpleEnumerator *result = new nsArrayEnumerator(cmdArray);
if (!result)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(result);
*commands = result;
return NS_OK;
return NS_NewArrayEnumerator(commands, cmdArray);
}
NS_IMETHODIMP

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

@ -894,9 +894,6 @@ RelatedLinksHandlerImpl::ArcLabelsOut(nsIRDFResource *aSource,
rv = NS_NewISupportsArray(getter_AddRefs(array));
if (NS_FAILED(rv)) return rv;
nsISimpleEnumerator* result = new nsArrayEnumerator(array);
if (! result) return(NS_ERROR_OUT_OF_MEMORY);
PRBool hasValueFlag = PR_FALSE;
if ((aSource == kNC_RelatedLinksRoot) ||
(NS_SUCCEEDED(rv = mInner->HasAssertion(aSource, kRDF_type,
@ -905,9 +902,8 @@ RelatedLinksHandlerImpl::ArcLabelsOut(nsIRDFResource *aSource,
{
array->AppendElement(kNC_Child);
}
NS_ADDREF(result);
*aLabels = result;
return(NS_OK);
return NS_NewArrayEnumerator(aLabels, array);
}

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

@ -1583,13 +1583,7 @@ InternetSearchDataSource::ArcLabelsOut(nsIRDFResource *source,
array->AppendElement(mNC_Child);
nsISimpleEnumerator* result = new nsArrayEnumerator(array);
if (! result)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(result);
*labels = result;
return(NS_OK);
return NS_NewArrayEnumerator(labels, array);
}
if ((isSearchCategoryURI(source)) && (categoryDataSource))
@ -1776,12 +1770,7 @@ InternetSearchDataSource::GetAllCmds(nsIRDFResource* source,
// always append a separator last (due to aggregation of commands from multiple datasources)
cmdArray->AppendElement(mNC_BookmarkSeparator);
nsISimpleEnumerator *result = new nsArrayEnumerator(cmdArray);
if (!result)
return(NS_ERROR_OUT_OF_MEMORY);
NS_ADDREF(result);
*commands = result;
return(NS_OK);
return NS_NewArrayEnumerator(commands, cmdArray);
}

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

@ -636,14 +636,7 @@ LocalSearchDataSource::getFindResults(nsIRDFResource *source, nsISimpleEnumerato
rv = parseFindURL(source, nameArray);
if (NS_FAILED(rv)) return rv;
nsISimpleEnumerator* result = new nsArrayEnumerator(nameArray);
if (! result)
return(NS_ERROR_OUT_OF_MEMORY);
NS_ADDREF(result);
*aResult = result;
return NS_OK;
return NS_NewArrayEnumerator(aResult, nameArray);
}
@ -694,15 +687,7 @@ LocalSearchDataSource::GetTargets(nsIRDFResource *source,
rv = getFindName(source, getter_AddRefs(name));
if (NS_FAILED(rv)) return rv;
nsISimpleEnumerator* result =
new nsSingletonEnumerator(name);
if (! result)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(result);
*targets = result;
return NS_OK;
return NS_NewSingletonEnumerator(targets, name);
}
else if (property == kRDF_type)
{
@ -711,38 +696,24 @@ LocalSearchDataSource::GetTargets(nsIRDFResource *source,
if (NS_FAILED(rv)) return rv;
nsAutoString url; url.AssignWithConversion(uri);
nsIRDFLiteral *literal;
rv = gRDFService->GetLiteral(url.get(), &literal);
nsCOMPtr<nsIRDFLiteral> literal;
rv = gRDFService->GetLiteral(url.get(),
getter_AddRefs(literal));
if (NS_FAILED(rv)) return rv;
nsISimpleEnumerator* result = new nsSingletonEnumerator(literal);
NS_RELEASE(literal);
if (! result)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(result);
*targets = result;
return NS_OK;
return NS_NewSingletonEnumerator(targets, literal);
}
else if (property == kNC_pulse)
{
nsAutoString pulse(NS_LITERAL_STRING("15"));
nsIRDFLiteral *pulseLiteral;
rv = gRDFService->GetLiteral(pulse.get(), &pulseLiteral);
nsCOMPtr<nsIRDFLiteral> pulseLiteral;
rv = gRDFService->GetLiteral(pulse.get(),
getter_AddRefs(pulseLiteral));
if (NS_FAILED(rv)) return rv;
nsISimpleEnumerator* result = new nsSingletonEnumerator(pulseLiteral);
NS_RELEASE(pulseLiteral);
if (! result)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(result);
*targets = result;
return NS_OK;
return NS_NewSingletonEnumerator(targets, pulseLiteral);
}
}
@ -895,13 +866,7 @@ LocalSearchDataSource::ArcLabelsOut(nsIRDFResource *source,
array->AppendElement(kNC_Child);
array->AppendElement(kNC_pulse);
nsISimpleEnumerator* result = new nsArrayEnumerator(array);
if (! result)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(result);
*labels = result;
return(NS_OK);
return NS_NewArrayEnumerator(labels, array);
}
return(NS_NewEmptyEnumerator(labels));
}