зеркало из https://github.com/mozilla/pjs.git
Seamonkey-only bustage from bug 347183 - I'm currently building a tree with this, but it should be right
This commit is contained in:
Родитель
78625f54c6
Коммит
8fa0791d0e
|
@ -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));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче