Fix T59535: Select linked delimit doesn't refresh
authorCampbell Barton <ideasman42@gmail.com>
Tue, 18 Dec 2018 06:22:11 +0000 (17:22 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 18 Dec 2018 06:22:11 +0000 (17:22 +1100)
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_templates.c

index c0706ed84509f958d2dd14df9410cea2ae83da49..7778444435e596b9d41e64f23a55190f7594246e 100644 (file)
@@ -726,6 +726,8 @@ static void ui_item_enum_expand_exec(
                        but = uiDefButR_prop(block, but_type, 0, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
 
                if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
+                       /* If this is set, assert since we're clobbering someone elses callback. */
+                       BLI_assert(but->func == NULL);
                        UI_but_func_set(but, ui_item_enum_expand_handle, but, POINTER_FROM_INT(value));
                }
 
index d675f36fdea74f655262ecb8c44ed1fd8239ce9b..d1261ed5c7e4a328a2a0af6387eeecd8d3b94e44 100644 (file)
@@ -1893,9 +1893,9 @@ void uiTemplateOperatorRedoProperties(uiLayout *layout, const bContext *C)
                bool has_advanced = false;
 #endif
 
-               UI_block_func_set(block, ED_undo_operator_repeat_cb, op, NULL);
+               UI_block_func_handle_set(block, ED_undo_operator_repeat_cb_evt, op);
                template_operator_redo_property_buts_draw(C, op, layout, layout_flags, NULL /* &has_advanced */ );
-               UI_block_func_set(block, NULL, NULL, NULL); /* may want to reset to old state instead of NULLing all */
+               /* Warning! this leaves the handle function for any other users of this block. */
 
 #if 0
                if (has_advanced) {