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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user