diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 07:29:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 07:42:03 +0300 |
commit | 2d803d3f6d803ab6098410c56048f1df1ba48ee0 (patch) | |
tree | bf424d7588067f9c3350bf6030cbda0f12d5d50d /source/blender/editors | |
parent | 4f140ec7cc08e52eddae36f31bd7278506140679 (diff) |
Cleanup: use STR_ELEM macro
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_convert.c | 12 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_extrude_spin.c | 3 | ||||
-rw-r--r-- | source/blender/editors/object/object_data_transfer.c | 3 | ||||
-rw-r--r-- | source/blender/editors/sound/sound_ops.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_group.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_add.c | 5 |
7 files changed, 22 insertions, 17 deletions
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index 2d9f49fa1ed..237b5839c42 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -1616,9 +1616,13 @@ static bool gpencil_convert_poll_property(const bContext *UNUSED(C), const bool valid_timing = RNA_boolean_get(ptr, "use_timing_data"); /* Always show those props */ - if (STREQ(prop_id, "type") || STREQ(prop_id, "use_normalize_weights") || - STREQ(prop_id, "radius_multiplier") || STREQ(prop_id, "use_link_strokes") || - STREQ(prop_id, "bevel_depth") || STREQ(prop_id, "bevel_resolution")) { + if (STR_ELEM(prop_id, + "type", + "use_normalize_weights", + "radius_multiplier", + "use_link_strokes", + "bevel_depth", + "bevel_resolution")) { return true; } @@ -1635,7 +1639,7 @@ static bool gpencil_convert_poll_property(const bContext *UNUSED(C), if (timing_mode != GP_STROKECONVERT_TIMING_NONE) { /* Only show when link_stroke is true and stroke timing is enabled */ - if (STREQ(prop_id, "frame_range") || STREQ(prop_id, "start_frame")) { + if (STR_ELEM(prop_id, "frame_range", "start_frame")) { return true; } diff --git a/source/blender/editors/mesh/editmesh_extrude_spin.c b/source/blender/editors/mesh/editmesh_extrude_spin.c index 6dde45a4f5f..7b3fabf07fc 100644 --- a/source/blender/editors/mesh/editmesh_extrude_spin.c +++ b/source/blender/editors/mesh/editmesh_extrude_spin.c @@ -24,6 +24,7 @@ #include "DNA_object_types.h" #include "BLI_math.h" +#include "BLI_string.h" #include "BKE_context.h" #include "BKE_editmesh.h" @@ -172,7 +173,7 @@ static bool edbm_spin_poll_property(const bContext *UNUSED(C), const bool dupli = RNA_boolean_get(op->ptr, "dupli"); if (dupli) { - if (STREQ(prop_id, "use_auto_merge") || STREQ(prop_id, "use_normal_flip")) { + if (STR_ELEM(prop_id, "use_auto_merge", "use_normal_flip")) { return false; } } diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 4884df1edb6..0bd358e1063 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -28,6 +28,7 @@ #include "BLI_blenlib.h" #include "BLI_math.h" +#include "BLI_string.h" #include "BLI_utildefines.h" #include "BKE_context.h" @@ -585,7 +586,7 @@ static bool data_transfer_poll_property(const bContext *UNUSED(C), return false; } - if ((STREQ(prop_id, "layers_select_src") || STREQ(prop_id, "layers_select_dst")) && + if (STR_ELEM(prop_id, "layers_select_src", "layers_select_dst") && !DT_DATATYPE_IS_MULTILAYERS(data_type)) { return false; } diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 8e2bb6a4813..c6961cc9d4b 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -512,8 +512,7 @@ static bool sound_mixdown_draw_check_prop(PointerRNA *UNUSED(ptr), void *UNUSED(user_data)) { const char *prop_id = RNA_property_identifier(prop); - return !(STREQ(prop_id, "filepath") || STREQ(prop_id, "directory") || - STREQ(prop_id, "filename")); + return !(STR_ELEM(prop_id, "filepath", "directory", "filename")); } static void sound_mixdown_draw(bContext *C, wmOperator *op) diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 153b63d11fe..69e9c975bd1 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1436,8 +1436,7 @@ static bool image_open_draw_check_prop(PointerRNA *UNUSED(ptr), { const char *prop_id = RNA_property_identifier(prop); - return !(STREQ(prop_id, "filepath") || STREQ(prop_id, "directory") || - STREQ(prop_id, "filename")); + return !(STR_ELEM(prop_id, "filepath", "directory", "filename")); } static void image_open_draw(bContext *UNUSED(C), wmOperator *op) diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c index c6c14a9886e..cda07bb1233 100644 --- a/source/blender/editors/space_node/node_group.c +++ b/source/blender/editors/space_node/node_group.c @@ -31,6 +31,7 @@ #include "BLI_linklist.h" #include "BLI_listbase.h" #include "BLI_math.h" +#include "BLI_string.h" #include "BLT_translation.h" @@ -68,10 +69,11 @@ static bool node_group_operator_active(bContext *C) * Disabled otherwise to allow pynodes define their own operators * with same keymap. */ - if (STREQ(snode->tree_idname, "ShaderNodeTree") || - STREQ(snode->tree_idname, "CompositorNodeTree") || - STREQ(snode->tree_idname, "TextureNodeTree") || - STREQ(snode->tree_idname, "SimulationNodeTree")) { + if (STR_ELEM(snode->tree_idname, + "ShaderNodeTree", + "CompositorNodeTree", + "TextureNodeTree", + "SimulationNodeTree")) { return true; } } diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index e16004639fe..7335882e947 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -315,7 +315,7 @@ static bool seq_effect_add_properties_poll(const bContext *UNUSED(C), /* Hide start/end frames for effect strips that are locked to their parents' location. */ if (BKE_sequence_effect_get_num_inputs(type) != 0) { - if ((STREQ(prop_id, "frame_start")) || (STREQ(prop_id, "frame_end"))) { + if (STR_ELEM(prop_id, "frame_start", "frame_end")) { return false; } } @@ -639,8 +639,7 @@ static bool sequencer_add_draw_check_fn(PointerRNA *UNUSED(ptr), { const char *prop_id = RNA_property_identifier(prop); - return !(STREQ(prop_id, "filepath") || STREQ(prop_id, "directory") || - STREQ(prop_id, "filename")); + return !(STR_ELEM(prop_id, "filepath", "directory", "filename")); } static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op) |