Merging r39634 through r39716 from trunk into soc-2011-tomato
[blender-staging.git] / source / blender / windowmanager / intern / wm_operators.c
index af791ca6cf23be0bc60b6132d86f49ef05693bdc..c30e48e68eff8dec6eed15250a64210d1bc0a682 100644 (file)
@@ -213,6 +213,7 @@ static int wm_macro_exec(bContext *C, wmOperator *op)
                
                if(opm->type->exec) {
                        retval= opm->type->exec(C, opm);
+                       OPERATOR_RETVAL_CHECK(retval);
                
                        if (retval & OPERATOR_FINISHED) {
                                MacroData *md = op->customdata;
@@ -237,6 +238,8 @@ static int wm_macro_invoke_internal(bContext *C, wmOperator *op, wmEvent *event,
                else if(opm->type->exec)
                        retval= opm->type->exec(C, opm);
 
+               OPERATOR_RETVAL_CHECK(retval);
+
                BLI_movelisttolist(&op->reports->list, &opm->reports->list);
                
                if (retval & OPERATOR_FINISHED) {
@@ -265,6 +268,7 @@ static int wm_macro_modal(bContext *C, wmOperator *op, wmEvent *event)
                printf("macro error, calling NULL modal()\n");
        else {
                retval = opm->type->modal(C, opm, event);
+               OPERATOR_RETVAL_CHECK(retval);
 
                /* if this one is done but it's not the last operator in the macro */
                if ((retval & OPERATOR_FINISHED) && opm->next) {
@@ -655,7 +659,9 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
                printf("WM_menu_invoke: %s \"%s\" is not an enum property\n", op->type->idname, RNA_property_identifier(prop));
        }
        else if (RNA_property_is_set(op->ptr, RNA_property_identifier(prop))) {
-               return op->type->exec(C, op);
+               const int retval= op->type->exec(C, op);
+               OPERATOR_RETVAL_CHECK(retval);
+               return retval;
        }
        else {
                pup= uiPupMenuBegin(C, op->type->name, ICON_NONE);
@@ -2345,7 +2351,6 @@ static void gesture_circle_apply(bContext *C, wmOperator *op)
        
        if(op->type->exec)
                op->type->exec(C, op);
-
 #ifdef GESTURE_MEMORY
        circle_select_size= rect->xmax;
 #endif
@@ -2566,7 +2571,6 @@ static void gesture_lasso_apply(bContext *C, wmOperator *op)
                
        if(op->type->exec)
                op->type->exec(C, op);
-       
 }
 
 int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event)