diff options
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 36 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve_query.c | 6 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve_select.c | 25 | ||||
-rw-r--r-- | source/blender/editors/curve/editfont.c | 32 |
4 files changed, 38 insertions, 61 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index a39c8261b32..38ab917ba72 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -2436,12 +2436,12 @@ static void adduplicateflagNurb( /* actvert in cyclicu selection */ break; } - else if (calc_duplicate_actvert(editnurb, - newnurb, - cu, - starta, - starta + newu, - cu->actvert - starta + b * newnu->pntsu)) { + if (calc_duplicate_actvert(editnurb, + newnurb, + cu, + starta, + starta + newu, + cu->actvert - starta + b * newnu->pntsu)) { /* actvert in 'current' iteration selection */ break; } @@ -4544,15 +4544,13 @@ static int make_segment_exec(bContext *C, wmOperator *op) if (nu_select_num > 1) { break; } - else { - /* only 1 selected, not first or last, a little complex, but intuitive */ - if (nu->pntsv == 1) { - if ((nu->bp->f1 & SELECT) || (nu->bp[nu->pntsu - 1].f1 & SELECT)) { - /* pass */ - } - else { - break; - } + /* only 1 selected, not first or last, a little complex, but intuitive */ + if (nu->pntsv == 1) { + if ((nu->bp->f1 & SELECT) || (nu->bp[nu->pntsu - 1].f1 & SELECT)) { + /* pass */ + } + else { + break; } } } @@ -5593,9 +5591,7 @@ static int add_vertex_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } - else { - return OPERATOR_CANCELLED; - } + return OPERATOR_CANCELLED; } static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) @@ -6517,9 +6513,7 @@ static int curve_delete_exec(bContext *C, wmOperator *op) if (changed_multi) { return OPERATOR_FINISHED; } - else { - return OPERATOR_CANCELLED; - } + return OPERATOR_CANCELLED; } static const EnumPropertyItem curve_delete_type_items[] = { diff --git a/source/blender/editors/curve/editcurve_query.c b/source/blender/editors/curve/editcurve_query.c index 132f7e58e71..774065b06ff 100644 --- a/source/blender/editors/curve/editcurve_query.c +++ b/source/blender/editors/curve/editcurve_query.c @@ -191,7 +191,8 @@ void ED_curve_nurb_vert_selected_find( *r_bezt = NULL; return; } - else if (*r_bezt || *r_bp) { + + if (*r_bezt || *r_bp) { *r_bp = NULL; *r_bezt = NULL; } @@ -214,7 +215,8 @@ void ED_curve_nurb_vert_selected_find( *r_nu = NULL; return; } - else if (*r_bezt || *r_bp) { + + if (*r_bezt || *r_bp) { *r_bp = NULL; *r_bezt = NULL; } diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c index 73f970876b1..b60eb258916 100644 --- a/source/blender/editors/curve/editcurve_select.c +++ b/source/blender/editors/curve/editcurve_select.c @@ -66,12 +66,11 @@ bool select_beztriple(BezTriple *bezt, bool selstatus, short flag, eVisible_Type bezt->f3 |= flag; return true; } - else { /* deselects */ - bezt->f1 &= ~flag; - bezt->f2 &= ~flag; - bezt->f3 &= ~flag; - return true; - } + /* deselects */ + bezt->f1 &= ~flag; + bezt->f2 &= ~flag; + bezt->f3 &= ~flag; + return true; } return false; @@ -85,10 +84,8 @@ bool select_bpoint(BPoint *bp, bool selstatus, short flag, bool hidden) bp->f1 |= flag; return true; } - else { - bp->f1 &= ~flag; - return true; - } + bp->f1 &= ~flag; + return true; } return false; @@ -99,9 +96,7 @@ static bool swap_selection_beztriple(BezTriple *bezt) if (bezt->f2 & SELECT) { return select_beztriple(bezt, DESELECT, SELECT, VISIBLE); } - else { - return select_beztriple(bezt, SELECT, SELECT, VISIBLE); - } + return select_beztriple(bezt, SELECT, SELECT, VISIBLE); } static bool swap_selection_bpoint(BPoint *bp) @@ -109,9 +104,7 @@ static bool swap_selection_bpoint(BPoint *bp) if (bp->f1 & SELECT) { return select_bpoint(bp, DESELECT, SELECT, VISIBLE); } - else { - return select_bpoint(bp, SELECT, SELECT, VISIBLE); - } + return select_bpoint(bp, SELECT, SELECT, VISIBLE); } bool ED_curve_nurb_select_check(View3D *v3d, Nurb *nu) diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 1bbd4b4a5bc..b759277572c 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -373,9 +373,7 @@ static wchar_t findaccent(wchar_t char1, uint code) if (new) { return new; } - else { - return char1; - } + return char1; } static int insert_into_textbuf(Object *obedit, uintptr_t c) @@ -403,9 +401,7 @@ static int insert_into_textbuf(Object *obedit, uintptr_t c) return 1; } - else { - return 0; - } + return 0; } static void text_update_edited(bContext *C, Object *obedit, int mode) @@ -887,9 +883,7 @@ static int font_select_all_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } - else { - return OPERATOR_CANCELLED; - } + return OPERATOR_CANCELLED; } void FONT_OT_select_all(wmOperatorType *ot) @@ -1015,10 +1009,9 @@ static bool paste_selection(Object *obedit, ReportList *reports) if (font_paste_wchar(obedit, text_buf, len, info_buf)) { return true; } - else { - BKE_report(reports, RPT_WARNING, "Text too long"); - return false; - } + + BKE_report(reports, RPT_WARNING, "Text too long"); + return false; } static int paste_text_exec(bContext *C, wmOperator *op) @@ -1347,9 +1340,7 @@ static int change_spacing_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } - else { - return OPERATOR_CANCELLED; - } + return OPERATOR_CANCELLED; } void FONT_OT_change_spacing(wmOperatorType *ot) @@ -1688,9 +1679,8 @@ static int insert_text_invoke(bContext *C, wmOperator *op, const wmEvent *event) if ((alt || ctrl || shift) == 0) { return OPERATOR_PASS_THROUGH; } - else { - ascii = 9; - } + + ascii = 9; } if (event_type == EVT_BACKSPACEKEY) { @@ -2290,9 +2280,7 @@ bool ED_curve_editfont_select_pick( } return true; } - else { - return false; - } + return false; } /** \} */ |