Bug 11488: Crash when deleting options from GFX selects

git-svn-id: svn://10.0.0.236/trunk@48569 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pollmann%netscape.com
1999-09-21 13:25:32 +00:00
parent d886171d24
commit e721d4ecd3
2 changed files with 6 additions and 6 deletions

View File

@@ -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
}

View File

@@ -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
}