diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-25 03:10:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-25 03:11:07 +0300 |
commit | b5a2dc16fc4853f45be289a435f5e1fff2c74c9e (patch) | |
tree | bcb7f28ce28b615f0384c11468cb9cdb2a8d3890 /source/blender/windowmanager/intern | |
parent | d4433b1bb36036314a876e2b0d153c1f62e687b7 (diff) |
Revert "WM: Repeat Last no longer reuses skip-save properties"
This reverts commit 1d908bffddb4c9815a986305ad4588032b81deee.
Enough uses of repeat last expect skip-save properties to be set,
transform being the most obvious example T60777#605681.
I wanted to avoid operators having account for two kinds of 'skip-save'
but this may be unavoidable.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 54 |
1 files changed, 4 insertions, 50 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 29bbd6b0641..0362f393bdb 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1041,42 +1041,6 @@ int WM_operator_repeat(bContext *C, wmOperator *op) return wm_operator_exec(C, op, true, true); } /** - * Execute this operator again interactively - * without using #PROP_SKIP_SAVE properties, see: T60777. - */ -int WM_operator_repeat_interactive(bContext *C, wmOperator *op) -{ - IDProperty *properties = op->properties ? IDP_New(IDP_GROUP, &(IDPropertyTemplate){0}, "wmOperatorProperties") : NULL; - PointerRNA *ptr = MEM_dupallocN(op->ptr); - - SWAP(IDProperty *, op->properties, properties); - SWAP(PointerRNA *, op->ptr, ptr); - if (op->ptr) { - op->ptr->data = op->properties; - } - - /* Use functionality to initialize from previous execution to avoid re-using PROP_SKIP_SAVE. */ - if (properties) { - WM_operator_last_properties_init_ex(op, properties); - } - - int retval = wm_operator_exec(C, op, true, true); - - SWAP(IDProperty *, op->properties, properties); - SWAP(PointerRNA *, op->ptr, ptr); - - if (properties) { - IDP_FreeProperty(properties); - MEM_freeN(properties); - } - if (ptr) { - MEM_freeN(ptr); - } - - return retval; -} - -/** * \return true if #WM_operator_repeat can run * simple check for now but may become more involved. * To be sure the operator can run call `WM_operator_poll(C, op->type)` also, since this call @@ -1262,13 +1226,13 @@ static bool operator_last_properties_init_impl(wmOperator *op, IDProperty *last_ return changed; } -bool WM_operator_last_properties_init_ex(wmOperator *op, IDProperty *last_properties) +bool WM_operator_last_properties_init(wmOperator *op) { bool changed = false; - if (last_properties) { - changed |= operator_last_properties_init_impl(op, last_properties); + if (op->type->last_properties) { + changed |= operator_last_properties_init_impl(op, op->type->last_properties); for (wmOperator *opm = op->macro.first; opm; opm = opm->next) { - IDProperty *idp_src = IDP_GetPropertyFromGroup(last_properties, opm->idname); + IDProperty *idp_src = IDP_GetPropertyFromGroup(op->type->last_properties, opm->idname); if (idp_src) { changed |= operator_last_properties_init_impl(opm, idp_src); } @@ -1277,11 +1241,6 @@ bool WM_operator_last_properties_init_ex(wmOperator *op, IDProperty *last_proper return changed; } -bool WM_operator_last_properties_init(wmOperator *op) -{ - return WM_operator_last_properties_init_ex(op, op->type->last_properties); -} - bool WM_operator_last_properties_store(wmOperator *op) { if (op->type->last_properties) { @@ -1313,11 +1272,6 @@ bool WM_operator_last_properties_store(wmOperator *op) #else -bool WM_operator_last_properties_init_ex(wmOperator *UNUSED(op), IDProperty *UNUSED(last_properties)) -{ - return false; -} - bool WM_operator_last_properties_init(wmOperator *UNUSED(op)) { return false; |