Fix bug # 51021. r=me

git-svn-id: svn://10.0.0.236/trunk@78202 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rjc%netscape.com
2000-09-06 00:24:15 +00:00
parent 029db4bdd6
commit eb2e86b467

View File

@@ -1138,7 +1138,7 @@ BookmarkParser::ParseBookmarkInfo(BookmarkField *fields, PRBool isBookmarkFlag,
Unescape(name);
nsCOMPtr<nsIRDFNode> nameNode;
nsresult rv = ParseLiteral(kNC_Name, name, getter_AddRefs(nameNode));
rv = ParseLiteral(kNC_Name, name, getter_AddRefs(nameNode));
if (NS_SUCCEEDED(rv) && nameNode)
{
updateAtom(mDataSource, bookmark, kNC_Name, nameNode, nsnull);
@@ -1159,10 +1159,16 @@ BookmarkParser::ParseBookmarkInfo(BookmarkField *fields, PRBool isBookmarkFlag,
}
}
// The last thing we do is add the bookmark to the container.
// This ensures the minimal amount of reflow.
nsresult rv = aContainer->AppendElement(bookmark);
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to add bookmark to container");
// prevent duplicates
PRInt32 aIndex;
if (NS_SUCCEEDED(aContainer->IndexOf(bookmark, &aIndex)) &&
(aIndex < 0))
{
// 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");
}
}
// free up any allocated data in field table