Bug 296261. Fix nsIAccessible::GetPreviousSibling regression. r=parente, sr=neil, a=chofmann

This commit is contained in:
aaronleventhal%moonset.net 2005-06-02 20:13:59 +00:00
Родитель d29d2a1e55
Коммит e100f4addf
1 изменённых файлов: 5 добавлений и 7 удалений

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

@ -424,16 +424,14 @@ NS_IMETHODIMP nsAccessible::GetPreviousSibling(nsIAccessible * *aPreviousSibling
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
if (!mParent) { nsCOMPtr<nsIAccessible> parent;
nsCOMPtr<nsIAccessible> parent; if (NS_FAILED(GetParent(getter_AddRefs(parent)))) {
if (NS_FAILED(GetParent(getter_AddRefs(parent)))) { return NS_ERROR_FAILURE;
return NS_ERROR_FAILURE;
}
} }
nsCOMPtr<nsIAccessible> testAccessible, prevSibling; nsCOMPtr<nsIAccessible> testAccessible, prevSibling;
mParent->GetFirstChild(getter_AddRefs(testAccessible)); parent->GetFirstChild(getter_AddRefs(testAccessible));
while (testAccessible) { while (testAccessible && this != testAccessible) {
prevSibling = testAccessible; prevSibling = testAccessible;
prevSibling->GetNextSibling(getter_AddRefs(testAccessible)); prevSibling->GetNextSibling(getter_AddRefs(testAccessible));
} }