if (fullURL.FindChar(PRUnichar(':')) < 0) { fullURL.Insert("http: }
nsresult rv;
BookmarkParser::AddBookmark(nsCOMPtr<nsIRDFContainer> aContainer,                            const char*      aURL,                            const PRUnichar* aOptionalTitle,                            PRInt32          aAddDate,                            PRInt32          aLastVisitDate,                            PRInt32          aLastModifiedDate,                            const char*      aShortcutURL,                            nsIRDFResource*  aNodeType,                            nsIRDFResource** bookmarkNode){	nsresult	rv;	nsAutoString	fullURL(aURL);	// hack fix for bug # 21175:	// if we don't have a protocol scheme, add "http://" as a default scheme	if (fullURL.FindChar(PRUnichar(':')) < 0)	{		fullURL.Insert("http://", 0);	}	nsCOMPtr<nsIRDFResource> bookmark;	if (NS_FAILED(rv = gRDF->GetResource(nsCAutoString(fullURL), getter_AddRefs(bookmark) )))	{		NS_ERROR("unable to get bookmark resource");		return(rv);	}	if (bookmarkNode)	{		*bookmarkNode = bookmark;		NS_ADDREF(*bookmarkNode);	}	if (nsnull != mIEFavoritesRoot)	{		if (!PL_strcmp(aURL, mIEFavoritesRoot))		{			mFoundIEFavoritesRoot = PR_TRUE;		}	}	rv = mDataSource->Assert(bookmark, kRDF_type, aNodeType, PR_TRUE);	if (rv != NS_RDF_ASSERTION_ACCEPTED)	{		NS_ERROR("unable to add bookmark to data source");		return(rv);	}	if ((nsnull != aOptionalTitle) && (*aOptionalTitle != PRUnichar('\0')))	{		nsCOMPtr<nsIRDFLiteral> literal;		if (NS_FAILED(rv = gRDF->GetLiteral(aOptionalTitle, getter_AddRefs(literal))))		{			NS_ERROR("unable to create literal for bookmark name");		}		if (NS_SUCCEEDED(rv))		{			rv = mDataSource->Assert(bookmark, kNC_Name, literal, PR_TRUE);			if (rv != NS_RDF_ASSERTION_ACCEPTED)			{				NS_ERROR("unable to set bookmark name");			}		}	}	AssertTime(bookmark, kNC_BookmarkAddDate, aAddDate);	AssertTime(bookmark, kWEB_LastVisitDate, aLastVisitDate);	AssertTime(bookmark, kWEB_LastModifiedDate, aLastModifiedDate);	if ((nsnull != aShortcutURL) && (*aShortcutURL != '\0'))	{		nsCOMPtr<nsIRDFLiteral> shortcutLiteral;		if (NS_FAILED(rv = gRDF->GetLiteral(nsAutoString(aShortcutURL).GetUnicode(),						    getter_AddRefs(shortcutLiteral))))		{			NS_ERROR("unable to get literal for bookmark shortcut URL");		}		if (NS_SUCCEEDED(rv) && (rv != NS_RDF_NO_VALUE))		{			rv = mDataSource->Assert(bookmark,						 kNC_ShortcutURL,						 shortcutLiteral,						 PR_TRUE);			if (rv != NS_RDF_ASSERTION_ACCEPTED)			{				NS_ERROR("unable to set bookmark shortcut URL");			}		}	}	// The last thing we do is add the bookmark to the container. This ensures the minimal amount of reflow.	rv = aContainer->AppendElement(bookmark);	NS_ASSERTION(NS_SUCCEEDED(rv), "unable to add bookmark to container");	return(rv);}