Bug 17995: Don't reset selection when adding an option to a combobox, as it caused reframing and a crash. r=harishd a=choffman

This commit is contained in:
pollmann%netscape.com 1999-11-06 00:54:54 +00:00
Родитель 69c4e300ac
Коммит 1ac4b75dcc
2 изменённых файлов: 8 добавлений и 2 удалений

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

@ -1091,7 +1091,10 @@ nsComboboxControlFrame::AddOption(nsIPresContext* aPresContext, PRInt32 aIndex)
NS_RELEASE(listFrame);
}
// If we added the first option, we might need to select it.
MakeSureSomethingIsSelected(aPresContext);
// We should call MakeSureSomethingIsSelected here, but since it
// it changes selection, which currently causes a reframe, and thus
// deletes the frame out from under the caller, causing a crash. (Bug 17995)
// XXX BAD MakeSureSomethingIsSelected(aPresContext);
return rv;
}

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

@ -1091,7 +1091,10 @@ nsComboboxControlFrame::AddOption(nsIPresContext* aPresContext, PRInt32 aIndex)
NS_RELEASE(listFrame);
}
// If we added the first option, we might need to select it.
MakeSureSomethingIsSelected(aPresContext);
// We should call MakeSureSomethingIsSelected here, but since it
// it changes selection, which currently causes a reframe, and thus
// deletes the frame out from under the caller, causing a crash. (Bug 17995)
// XXX BAD MakeSureSomethingIsSelected(aPresContext);
return rv;
}