nsAutoString			newName("");
nsAutoString			newName;
nsBookmarksService::insertBookmarkItem(nsIRDFResource *src, nsISupportsArray *aArguments, PRInt32 parentArgIndex, nsIRDFResource *objType){	nsresult			rv;	nsCOMPtr<nsIRDFResource>	argParent;	if (NS_FAILED(rv = getArgumentN(aArguments, kNC_Parent,			parentArgIndex, getter_AddRefs(argParent))))		return(rv);	nsCOMPtr<nsIRDFContainer>	container;	if (NS_FAILED(rv = nsComponentManager::CreateInstance(kRDFContainerCID, nsnull,			nsIRDFContainer::GetIID(), getter_AddRefs(container))))		return(rv);	if (NS_FAILED(rv = container->Init(mInner, argParent)))		return(rv);	PRInt32		srcIndex;	if (NS_FAILED(rv = container->IndexOf(src, &srcIndex)))		return(rv);	nsCOMPtr<nsIRDFResource>	newElement;	if (NS_FAILED(rv = BookmarkParser::CreateAnonymousResource(&newElement)))		return(rv);	// set a default name for bookmarks/folders	nsAutoString			newName("");	if (objType == kNC_Bookmark)	{		newName = "New Bookmark";		// XXX localization	}	else if (objType == kNC_Folder)	{		if (NS_FAILED(rv = gRDFC->MakeSeq(mInner, newElement, nsnull)))			return(rv);		newName = "New Folder";			// XXX localization	}	if (newName.Length() > 0)	{		nsCOMPtr<nsIRDFLiteral>	nameLiteral;		if (NS_FAILED(rv = gRDF->GetLiteral(newName.GetUnicode(), getter_AddRefs(nameLiteral))))			return(rv);		if (NS_FAILED(rv = mInner->Assert(newElement, kNC_Name, nameLiteral, PR_TRUE)))			return(rv);	}	if (NS_FAILED(rv = mInner->Assert(newElement, kRDF_type, objType, PR_TRUE)))		return(rv);	// convert the current date/time from microseconds (PRTime) to seconds	nsCOMPtr<nsIRDFDate>	dateLiteral;	if (NS_FAILED(rv = gRDF->GetDateLiteral(PR_Now(), getter_AddRefs(dateLiteral))))		return(rv);	if (NS_FAILED(rv = mInner->Assert(newElement, kNC_BookmarkAddDate, dateLiteral, PR_TRUE)))		return(rv);	if (NS_FAILED(rv = container->InsertElementAt(newElement, srcIndex + 1, PR_TRUE)))		return(rv);	return(rv);}