if (NS_FAILED(rv = gRDF->GetResource(fullurlC, getter_AddRefs(bookmark) )))
if (NS_FAILED(rv = gRDF->GetResource(fullurlC.get(), getter_AddRefs(bookmark) )))
BookmarkParser::AddBookmark(nsCOMPtr<nsIRDFContainer> aContainer,                            const char*      aURL,                            const PRUnichar* aOptionalTitle,                            PRInt32          aAddDate,                            PRInt32          aLastVisitDate,                            PRInt32          aLastModifiedDate,                            const char*      aShortcutURL,                            nsIRDFResource*  aNodeType,                            nsIRDFResource** bookmarkNode,                            const PRUnichar* aCharset,                            PRInt32          aIndex){	nsresult	rv;	nsAutoString	fullURL;	fullURL.AssignWithConversion(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.InsertWithConversion("http://", 0);	}	nsCOMPtr<nsIRDFResource> bookmark;	nsCAutoString fullurlC;	fullurlC.AssignWithConversion(fullURL);	if (NS_FAILED(rv = gRDF->GetResource(fullurlC, getter_AddRefs(bookmark) )))	{		NS_ERROR("unable to get bookmark resource");		return(rv);	}	if (bookmarkNode)	{		*bookmarkNode = bookmark;		NS_ADDREF(*bookmarkNode);	}	PRBool		isIEFavoriteRoot = PR_FALSE;	if (!mIEFavoritesRoot.IsEmpty())	{		if (mIEFavoritesRoot.EqualsIgnoreCase(aURL))		{			mFoundIEFavoritesRoot = PR_TRUE;			isIEFavoriteRoot = PR_TRUE;		}	}	if (isIEFavoriteRoot == PR_TRUE)	{		rv = mDataSource->Assert(bookmark, kRDF_type, kNC_IEFavoriteFolder, PR_TRUE);	}	else	{		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> titleLiteral;		if (NS_SUCCEEDED(rv = gRDF->GetLiteral(aOptionalTitle, getter_AddRefs(titleLiteral))))		{		    updateAtom(mDataSource, bookmark, kNC_Name, titleLiteral, nsnull);		}		else		{			NS_ERROR("unable to create literal for bookmark name");		}	}    AssertTime(bookmark, kNC_BookmarkAddDate, aAddDate);    AssertTime(bookmark, kWEB_LastVisitDate, aLastVisitDate);    AssertTime(bookmark, kWEB_LastModifiedDate, aLastModifiedDate);    if ((nsnull != aCharset) && (*aCharset != PRUnichar('\0')))    {        nsCOMPtr<nsIRDFLiteral> charsetliteral;        if (NS_SUCCEEDED(rv = gRDF->GetLiteral(aCharset, getter_AddRefs(charsetliteral))))        {            updateAtom(mDataSource, bookmark, kWEB_LastCharset, charsetliteral, nsnull);        }        else        {            NS_ERROR("unable to create literal for bookmark document charset");        }    }	if ((nsnull != aShortcutURL) && (*aShortcutURL != '\0'))	{		nsCOMPtr<nsIRDFLiteral> shortcutLiteral;		if (NS_SUCCEEDED(rv = gRDF->GetLiteral(NS_ConvertASCIItoUCS2(aShortcutURL).get(),						    getter_AddRefs(shortcutLiteral))))		{		    updateAtom(mDataSource, bookmark, kNC_ShortcutURL, shortcutLiteral, nsnull);		}		else		{			NS_ERROR("unable to get literal for bookmark shortcut URL");		}	}	// The last thing we do is add the bookmark to the container. This ensures the minimal amount of reflow.  if (aIndex < 0)  	rv = aContainer->AppendElement(bookmark);  else    rv = aContainer->InsertElementAt(bookmark, aIndex, PR_TRUE);	NS_ASSERTION(NS_SUCCEEDED(rv), "unable to add bookmark to container");	return(rv);}