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:
authorJoshua Leung <aligorith@gmail.com>2012-10-08 12:44:48 +0400
committerJoshua Leung <aligorith@gmail.com>2012-10-08 12:44:48 +0400
commite91badc2666aa04af34473d71dc576afb52eec06 (patch)
tree18e160e39b5ae35b40180a025dac5ed79ca0fece /source/blender/editors/space_outliner
parent9fa36b12cc6b123ca1c0f1034ab2539c09081db6 (diff)
Code cleanup - Convert if blocks to switch
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index bf76fdda61e..09df1d57b2b 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -1160,37 +1160,49 @@ static int outliner_data_operation_exec(bContext *C, wmOperator *op)
event = RNA_enum_get(op->ptr, "type");
set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel);
- if (datalevel == TSE_POSE_CHANNEL) {
- if (event > 0) {
+ if (event <= 0)
+ return OPERATOR_CANCELLED;
+
+ switch (datalevel) {
+ case TSE_POSE_CHANNEL:
+ {
outliner_do_data_operation(soops, datalevel, event, &soops->tree, pchan_cb, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
ED_undo_push(C, "PoseChannel operation");
}
- }
- else if (datalevel == TSE_BONE) {
- if (event > 0) {
+ break;
+
+ case TSE_BONE:
+ {
outliner_do_data_operation(soops, datalevel, event, &soops->tree, bone_cb, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
ED_undo_push(C, "Bone operation");
}
- }
- else if (datalevel == TSE_EBONE) {
- if (event > 0) {
+ break;
+
+ case TSE_EBONE:
+ {
outliner_do_data_operation(soops, datalevel, event, &soops->tree, ebone_cb, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
ED_undo_push(C, "EditBone operation");
}
- }
- else if (datalevel == TSE_SEQUENCE) {
- if (event > 0) {
+ break;
+
+ case TSE_SEQUENCE:
+ {
Scene *scene = CTX_data_scene(C);
outliner_do_data_operation(soops, datalevel, event, &soops->tree, sequence_cb, scene);
}
- }
- else if (datalevel == TSE_RNA_STRUCT) {
- if (event == 5) {
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, data_select_linked_cb, C);
- }
+ break;
+
+ case TSE_RNA_STRUCT:
+ if (event == 5) {
+ outliner_do_data_operation(soops, datalevel, event, &soops->tree, data_select_linked_cb, C);
+ }
+ break;
+
+ default:
+ break;
}
return OPERATOR_FINISHED;