commit patch #825: selection() returns a negative value by Erik Hovland <microe>

This commit is contained in:
Patrick Parker 2007-11-09 05:42:57 +00:00
parent 9a3af09f95
commit 8a4ec71537

View file

@ -789,7 +789,10 @@ void dialog::action(dialog_process_info& info)
//default way of handling a "delete item" request
if(result() == DELETE_ITEM) {
menu &menu_ref = get_menu();
menu_ref.erase_item(menu_ref.selection());
const int selection = menu_ref.selection();
if(selection >= 0) {
menu_ref.erase_item(selection);
}
if(menu_ref.nitems() == 0) {
set_result(CLOSE_DIALOG);
} else {