Bug 255792, nsSmallVoidArray::ReplaceElementAt does not work in the same way as nsVoidArray::ReplaceElementAt, r=rjesup,sr=alecf

This commit is contained in:
Olli.Pettay%helsinki.fi 2005-11-02 16:05:22 +00:00
Родитель 414673b72f
Коммит d19a0f5713
1 изменённых файлов: 12 добавлений и 7 удалений

Просмотреть файл

@ -1342,16 +1342,21 @@ nsSmallVoidArray::ReplaceElementAt(void* aElement, PRInt32 aIndex)
SetSingleChild(aElement);
return PR_TRUE;
}
return PR_FALSE;
}
else
{
nsVoidArray* vector = GetChildVector();
if (vector)
return vector->ReplaceElementAt(aElement, aIndex);
return PR_FALSE;
nsVoidArray* vector = GetChildVector();
if (!vector)
{
if (aIndex == 0)
{
SetSingleChild(aElement);
return PR_TRUE;
}
vector = SwitchToVector();
if (!vector)
return PR_FALSE;
}
return vector->ReplaceElementAt(aElement, aIndex);
}
PRBool