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:
authorSybren A. Stüvel <sybren@blender.org>2020-07-03 15:20:10 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-07-03 15:48:37 +0300
commitf3b8792b963b0b2a00fe7fe173f1beb85c209fbb (patch)
tree55ffa18ad4a6f2f03a127469780d47c54ad9bd74 /source/blender/editors/interface/interface_ops.c
parent86e7648f0edc13d613d8fc39af7758e08cfdf9e2 (diff)
Cleanup: Interface, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/editors/interface` module. No functional changes.
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r--source/blender/editors/interface/interface_ops.c64
1 files changed, 27 insertions, 37 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 924fc6738e1..5237e2ea3f7 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -209,10 +209,9 @@ static int copy_as_driver_button_exec(bContext *C, wmOperator *op)
MEM_freeN(path);
return OPERATOR_FINISHED;
}
- else {
- BKE_reportf(op->reports, RPT_ERROR, "Could not compute a valid data path");
- return OPERATOR_CANCELLED;
- }
+
+ BKE_reportf(op->reports, RPT_ERROR, "Could not compute a valid data path");
+ return OPERATOR_CANCELLED;
}
return OPERATOR_CANCELLED;
@@ -312,9 +311,7 @@ static int operator_button_property_finish(bContext *C, PointerRNA *ptr, Propert
/* do nothing, go ahead with undo */
return OPERATOR_FINISHED;
}
- else {
- return OPERATOR_CANCELLED;
- }
+ return OPERATOR_CANCELLED;
}
static bool reset_default_button_poll(bContext *C)
@@ -1005,11 +1002,9 @@ static bool copy_to_selected_button(bContext *C, bool all, bool poll)
success = true;
break;
}
- else {
- if (RNA_property_copy(bmain, &lptr, &ptr, prop, (all) ? -1 : index)) {
- RNA_property_update(C, &lptr, prop);
- success = true;
- }
+ if (RNA_property_copy(bmain, &lptr, &ptr, prop, (all) ? -1 : index)) {
+ RNA_property_update(C, &lptr, prop);
+ success = true;
}
}
}
@@ -1149,7 +1144,7 @@ static bool jump_to_target_button(bContext *C, bool poll)
return jump_to_target_ptr(C, target_ptr, poll);
}
/* For string properties with prop_search, look up the search collection item. */
- else if (type == PROP_STRING) {
+ if (type == PROP_STRING) {
const uiBut *but = UI_context_active_but_get(C);
if (but->type == UI_BTYPE_SEARCH_MENU && but->search &&
@@ -1265,9 +1260,7 @@ static bool ui_editsource_uibut_match(uiBut *but_a, uiBut *but_b)
STREQLEN(but_a->drawstr, but_b->drawstr, UI_MAX_DRAW_STR)) {
return true;
}
- else {
- return false;
- }
+ return false;
}
void UI_editsource_active_but_test(uiBut *but)
@@ -1323,22 +1316,21 @@ static int editsource_text_edit(bContext *C,
BKE_reportf(op->reports, RPT_WARNING, "File '%s' cannot be opened", filepath);
return OPERATOR_CANCELLED;
}
- else {
- /* naughty!, find text area to set, not good behavior
- * but since this is a dev tool lets allow it - campbell */
- ScrArea *area = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TEXT, 0);
- if (area) {
- SpaceText *st = area->spacedata.first;
- st->text = text;
- }
- else {
- BKE_reportf(op->reports, RPT_INFO, "See '%s' in the text editor", text->id.name + 2);
- }
- txt_move_toline(text, line - 1, false);
- WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, text);
+ /* naughty!, find text area to set, not good behavior
+ * but since this is a dev tool lets allow it - campbell */
+ ScrArea *area = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TEXT, 0);
+ if (area) {
+ SpaceText *st = area->spacedata.first;
+ st->text = text;
+ }
+ else {
+ BKE_reportf(op->reports, RPT_INFO, "See '%s' in the text editor", text->id.name + 2);
}
+ txt_move_toline(text, line - 1, false);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, text);
+
return OPERATOR_FINISHED;
}
@@ -1397,10 +1389,9 @@ static int editsource_exec(bContext *C, wmOperator *op)
return ret;
}
- else {
- BKE_report(op->reports, RPT_ERROR, "Active button not found");
- return OPERATOR_CANCELLED;
- }
+
+ BKE_report(op->reports, RPT_ERROR, "Active button not found");
+ return OPERATOR_CANCELLED;
}
static void UI_OT_editsource(wmOperatorType *ot)
@@ -1585,10 +1576,9 @@ static int edittranslation_exec(bContext *C, wmOperator *op)
return ret;
}
- else {
- BKE_report(op->reports, RPT_ERROR, "Active button not found");
- return OPERATOR_CANCELLED;
- }
+
+ BKE_report(op->reports, RPT_ERROR, "Active button not found");
+ return OPERATOR_CANCELLED;
}
static void UI_OT_edittranslation_init(wmOperatorType *ot)