commit patch #825: selection() returns a negative value by Erik Hovland <microe>
This commit is contained in:
parent
9a3af09f95
commit
8a4ec71537
1 changed files with 4 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue