diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-28 14:33:32 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-28 14:33:32 +0400 |
commit | 9caab2e26501f709109024ade3063e3762a19929 (patch) | |
tree | a5ec2737ef3097ecad89c162a02a3f427b58f46d /source/blender/editors/util/undo.c | |
parent | a434572654d95b2910324f3c6125580f4ee28afe (diff) |
code cleanup: replace some long ELEM7 checks with macro OB_TYPE_SUPPORT_EDITMODE()
Diffstat (limited to 'source/blender/editors/util/undo.c')
-rw-r--r-- | source/blender/editors/util/undo.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index a43d549cba1..cd88614f8fe 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -155,7 +155,7 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) ED_text_undo_step(C, step); } else if (obedit) { - if (ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)) { + if (OB_TYPE_SUPPORT_EDITMODE(obedit->type)) { if (undoname) undo_editmode_name(C, undoname); else @@ -247,7 +247,7 @@ int ED_undo_valid(const bContext *C, const char *undoname) return 1; } else if (obedit) { - if (ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)) { + if (OB_TYPE_SUPPORT_EDITMODE(obedit->type)) { return undo_editmode_valid(undoname); } } @@ -413,9 +413,11 @@ void ED_undo_operator_repeat_cb_evt(bContext *C, void *arg_op, int UNUSED(arg_ev /* ************************** */ -#define UNDOSYSTEM_GLOBAL 1 -#define UNDOSYSTEM_EDITMODE 2 -#define UNDOSYSTEM_PARTICLE 3 +enum { + UNDOSYSTEM_GLOBAL = 1, + UNDOSYSTEM_EDITMODE = 2, + UNDOSYSTEM_PARTICLE = 3 +}; static int get_undo_system(bContext *C) { @@ -423,8 +425,9 @@ static int get_undo_system(bContext *C) /* find out which undo system */ if (obedit) { - if (ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)) + if (OB_TYPE_SUPPORT_EDITMODE(obedit->type)) { return UNDOSYSTEM_EDITMODE; + } } else { Object *obact = CTX_data_active_object(C); |