Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-11-29 09:01:03 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-11-29 09:01:03 +0400
commit285e09bceb4d78cdefb046b5c58f8fa33a04ef05 (patch)
treeadb4bfa7074144c593bf01159bb0a8eafd972a09
parentfd88ce4d731e59d8880e32a84af153ee6d251cca (diff)
Fix T37149: Macros store settings from a cancelled operation
-rw-r--r--source/blender/windowmanager/WM_api.h1
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 0e202fda9ab..2402b8d61b9 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -239,6 +239,7 @@ bool WM_operator_properties_default(struct PointerRNA *ptr, const bool do
void WM_operator_properties_reset(struct wmOperator *op);
void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring);
void WM_operator_properties_create_ptr(struct PointerRNA *ptr, struct wmOperatorType *ot);
+void WM_operator_properties_clear(struct PointerRNA *ptr);
void WM_operator_properties_free(struct PointerRNA *ptr);
void WM_operator_properties_filesel(struct wmOperatorType *ot, int filter, short type, short action, short flag, short display);
void WM_operator_properties_border(struct wmOperatorType *ot);
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index a4c389d82ea..5d2edcecfba 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -296,6 +296,11 @@ static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event)
retval = opm->type->modal(C, opm, event);
OPERATOR_RETVAL_CHECK(retval);
+ /* if we're halfway through using a tool and cancel it, clear the options [#37149] */
+ if (retval & OPERATOR_CANCELLED) {
+ WM_operator_properties_clear(opm->ptr);
+ }
+
/* if this one is done but it's not the last operator in the macro */
if ((retval & OPERATOR_FINISHED) && opm->next) {
MacroData *md = op->customdata;
@@ -918,6 +923,15 @@ void WM_operator_properties_reset(wmOperator *op)
}
}
+void WM_operator_properties_clear(PointerRNA *ptr)
+{
+ IDProperty *properties = ptr->data;
+
+ if (properties) {
+ IDP_ClearProperty(properties);
+ }
+}
+
void WM_operator_properties_free(PointerRNA *ptr)
{
IDProperty *properties = ptr->data;