Bug 11488: Crash when deleting options from GFX selects

This commit is contained in:
pollmann%netscape.com 1999-09-21 13:25:32 +00:00
Родитель 3689b9be81
Коммит 9c3cf449e6
2 изменённых файлов: 6 добавлений и 6 удалений

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

@ -1607,10 +1607,10 @@ nsListControlFrame::RemoveOption(PRInt32 aIndex)
GetSelectedIndexFromDOM(&selectedIndex); // comes from the DOM
if (aIndex == mSelectedIndex) {
ToggleSelected(selectedIndex); // sets mSelectedIndex
} else {
mSelectedIndex = selectedIndex;
// Don't need to deselect option as it is being removed anyway.
SetContentSelected(selectedIndex, PR_TRUE); // Select the new selectedIndex
}
mSelectedIndex = selectedIndex;
if (nsnull != mComboboxFrame) {
mComboboxFrame->UpdateSelection(PR_FALSE, PR_TRUE, selectedIndex); // don't dispatch event
}

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

@ -1607,10 +1607,10 @@ nsListControlFrame::RemoveOption(PRInt32 aIndex)
GetSelectedIndexFromDOM(&selectedIndex); // comes from the DOM
if (aIndex == mSelectedIndex) {
ToggleSelected(selectedIndex); // sets mSelectedIndex
} else {
mSelectedIndex = selectedIndex;
// Don't need to deselect option as it is being removed anyway.
SetContentSelected(selectedIndex, PR_TRUE); // Select the new selectedIndex
}
mSelectedIndex = selectedIndex;
if (nsnull != mComboboxFrame) {
mComboboxFrame->UpdateSelection(PR_FALSE, PR_TRUE, selectedIndex); // don't dispatch event
}