during CloneAttributes, delete all the nodes attached (not half of them); discovered when fixing bug #14750; r=kin@netscape.com

This commit is contained in:
brade%netscape.com 1999-11-18 20:34:15 +00:00
parent 6e77f99f56
commit e727552d0d
2 changed files with 4 additions and 2 deletions

View File

@ -1507,7 +1507,8 @@ nsEditor::CloneAttributes(nsIDOMNode *aDestNode, nsIDOMNode *aSourceNode)
// Clear existing attributes
for (i = 0; i < destCount; i++)
{
if( NS_SUCCEEDED(destAttributes->Item(i, &attrNode)) && attrNode)
// always remove item number 0 (first item in list)
if( NS_SUCCEEDED(destAttributes->Item(0, &attrNode)) && attrNode)
{
nsCOMPtr<nsIDOMAttr> destAttribute = do_QueryInterface(attrNode);
if (destAttribute)

View File

@ -1507,7 +1507,8 @@ nsEditor::CloneAttributes(nsIDOMNode *aDestNode, nsIDOMNode *aSourceNode)
// Clear existing attributes
for (i = 0; i < destCount; i++)
{
if( NS_SUCCEEDED(destAttributes->Item(i, &attrNode)) && attrNode)
// always remove item number 0 (first item in list)
if( NS_SUCCEEDED(destAttributes->Item(0, &attrNode)) && attrNode)
{
nsCOMPtr<nsIDOMAttr> destAttribute = do_QueryInterface(attrNode);
if (destAttribute)