if (isSearchCommand(source) && (property == kNC_Name)) { nsresult rv; nsCOMPtr<nsIStringBundleService> stringService(do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv));  if (NS_SUCCEEDED(rv) && stringService) {  nsCOMPtr<nsIStringBundle> bundle; rv = stringService->CreateBundle(SEARCH_PROPERTIES, getter_AddRefs(bundle)); if (NS_SUCCEEDED(rv) && bundle) {  nsXPIDLString valUni; nsAutoString name;  if (source == kNC_SearchCommand_AddToBookmarks) name = NS_LITERAL_STRING("addtobookmarks"); else if (source == kNC_SearchCommand_FilterResult) name = NS_LITERAL_STRING("excludeurl"); else if (source == kNC_SearchCommand_FilterSite) name = NS_LITERAL_STRING("excludedomain"); else if (source == kNC_SearchCommand_ClearFilters) name = NS_LITERAL_STRING("clearfilters");  rv = bundle->GetStringFromName(name.get(), getter_Copies(valUni)); if (NS_SUCCEEDED(rv) && valUni && *valUni) { *target = nsnull; nsCOMPtr<nsIRDFLiteral> literal; if (NS_FAILED(rv = gRDFService->GetLiteral(valUni, getter_AddRefs(literal)))) return rv; *target = literal; NS_IF_ADDREF(*target); return rv; } } } }  if (isEngineURI(source)) {  nsCOMPtr<nsIRDFLiteral>	dataLit; FindData(source, getter_AddRefs(dataLit)); }
InternetSearchDataSource::GetTarget(nsIRDFResource *source,                                nsIRDFResource *property,                                PRBool tv,                                nsIRDFNode **target /* out */){	NS_PRECONDITION(source != nsnull, "null ptr");	if (! source)		return NS_ERROR_NULL_POINTER;	NS_PRECONDITION(property != nsnull, "null ptr");	if (! property)		return NS_ERROR_NULL_POINTER;	NS_PRECONDITION(target != nsnull, "null ptr");	if (! target)		return NS_ERROR_NULL_POINTER;	*target = nsnull;	nsresult		rv = NS_RDF_NO_VALUE;	// we only have positive assertions in the internet search data source.	if (! tv)		return(rv);	if ((isSearchCategoryURI(source)) && (categoryDataSource))	{		const char	*uri = nsnull;		source->GetValueConst(&uri);		if (!uri)	return(NS_ERROR_UNEXPECTED);		nsAutoString	catURI;		catURI.AssignWithConversion(uri);		nsCOMPtr<nsIRDFResource>	category;		nsCAutoString			caturiC;		caturiC.AssignWithConversion(catURI);		if (NS_FAILED(rv = gRDFService->GetResource(caturiC.get(),			getter_AddRefs(category))))			return(rv);		rv = categoryDataSource->GetTarget(category, property, tv, target);		return(rv);	}	if (isSearchCategoryEngineURI(source))	{		nsCOMPtr<nsIRDFResource>	trueEngine;		rv = resolveSearchCategoryEngineURI(source, getter_AddRefs(trueEngine));		if (NS_FAILED(rv) || (rv == NS_RDF_NO_VALUE))	return(rv);		if (!trueEngine)	return(NS_RDF_NO_VALUE);		source = trueEngine;	}	if (isSearchURI(source) && (property == kNC_Child))	{		// fake out the generic builder (i.e. return anything in this case)		// so that search containers never appear to be empty		*target = source;		NS_ADDREF(source);		return(NS_OK);	}	if (isSearchCommand(source) && (property == kNC_Name))	{    nsresult rv;    nsCOMPtr<nsIStringBundleService>    stringService(do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv));    if (NS_SUCCEEDED(rv) && stringService) {      nsCOMPtr<nsIStringBundle> bundle;      rv = stringService->CreateBundle(SEARCH_PROPERTIES, getter_AddRefs(bundle));      if (NS_SUCCEEDED(rv) && bundle) {        nsXPIDLString valUni;        nsAutoString name;        if (source == kNC_SearchCommand_AddToBookmarks)          name = NS_LITERAL_STRING("addtobookmarks");        else if (source == kNC_SearchCommand_FilterResult)          name = NS_LITERAL_STRING("excludeurl");        else if (source == kNC_SearchCommand_FilterSite)          name = NS_LITERAL_STRING("excludedomain");        else if (source == kNC_SearchCommand_ClearFilters)          name = NS_LITERAL_STRING("clearfilters");        rv = bundle->GetStringFromName(name.get(), getter_Copies(valUni));        if (NS_SUCCEEDED(rv) && valUni && *valUni) {          *target = nsnull;          nsCOMPtr<nsIRDFLiteral> literal;          if (NS_FAILED(rv = gRDFService->GetLiteral(valUni, getter_AddRefs(literal))))            return rv;          *target = literal;          NS_IF_ADDREF(*target);          return rv;        }      }    }  }	if (isEngineURI(source))	{		// if we're asking for info on a search engine, (deferred) load it if needed		nsCOMPtr<nsIRDFLiteral>	dataLit;		FindData(source, getter_AddRefs(dataLit));	}	if (mInner)	{		rv = mInner->GetTarget(source, property, tv, target);	}	return(rv);}