From c3a0be53c69e1a8355b70e7ed668d9aa1e010b74 Mon Sep 17 00:00:00 2001 From: deadwood Date: Fri, 22 Jul 2016 21:09:06 +0000 Subject: [PATCH] List.mui: Update entries count prior to range change Otherwise if the last entry is active and is removed, the range did not work and caused setting List_Active which was outside of range. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@52800 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/libs/muimaster/classes/list.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/workbench/libs/muimaster/classes/list.c b/workbench/libs/muimaster/classes/list.c index 8d1797084e..6bcd289031 100644 --- a/workbench/libs/muimaster/classes/list.c +++ b/workbench/libs/muimaster/classes/list.c @@ -2310,12 +2310,15 @@ IPTR List__MUIM_Remove(struct IClass *cl, Object *obj, } } - /* ensure that the active element is in a valid range (it might become + /* Update entries count prior to range check */ + SetAttrs(obj, MUIA_List_Entries, data->confirm_entries_num, TAG_DONE); + + /* Ensure that the active element is in a valid range (it might become * MUIV_List_Active_Off (-1), but that's OK) */ if (new_act >= data->entries_num) new_act = data->entries_num - 1; - SetAttrs(obj, MUIA_List_Entries, data->confirm_entries_num, + SetAttrs(obj, active_tag, new_act, /* Inform only if necessary (for notify) */ TAG_DONE); -- 2.11.4.GIT