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:
authorCampbell Barton <ideasman42@gmail.com>2019-03-25 02:15:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-25 03:16:46 +0300
commite86e0aad55675a5c4473d0538146dbccda7613e8 (patch)
treef20540ba9e01cc8d7e13090df8fbf9691cb8b01b /source/blender/editors/interface/interface_ops.c
parent72ede30d0f970fe7d6774ce0851e3aacc82e23d8 (diff)
Cleanup: use braces for interface code
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r--source/blender/editors/interface/interface_ops.c54
1 files changed, 36 insertions, 18 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index c7c039bf8f9..97dd79864e1 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -257,8 +257,9 @@ static int reset_default_button_exec(bContext *C, wmOperator *op)
/* if there is a valid property that is editable... */
if (ptr.data && prop && RNA_property_editable(&ptr, prop)) {
- if (RNA_property_reset(&ptr, prop, (all) ? -1 : index))
+ if (RNA_property_reset(&ptr, prop, (all) ? -1 : index)) {
return operator_button_property_finish(C, &ptr, prop);
+ }
}
return OPERATOR_CANCELLED;
@@ -316,8 +317,9 @@ static int assign_default_button_exec(bContext *C, wmOperator *UNUSED(op))
/* if there is a valid property that is editable... */
if (ptr.data && prop && RNA_property_editable(&ptr, prop)) {
- if (RNA_property_assign_default(&ptr, prop))
+ if (RNA_property_assign_default(&ptr, prop)) {
return operator_button_property_finish(C, &ptr, prop);
+ }
}
return OPERATOR_CANCELLED;
@@ -1298,8 +1300,9 @@ static void edittranslation_find_po_file(const char *root, const char *uilng, ch
BLI_snprintf(tstr, sizeof(tstr), "%s.po", uilng);
BLI_join_dirfile(path, maxlen, root, uilng);
BLI_path_append(path, maxlen, tstr);
- if (BLI_is_file(path))
+ if (BLI_is_file(path)) {
return;
+ }
/* Now try without the second iso code part (_ES in es_ES). */
{
@@ -1316,14 +1319,16 @@ static void edittranslation_find_po_file(const char *root, const char *uilng, ch
if (tstr[0]) {
/* Because of some codes like sr_SR@latin... */
tc = strchr(uilng, '@');
- if (tc)
+ if (tc) {
BLI_strncpy(tstr + szt, tc, sizeof(tstr) - szt);
+ }
BLI_join_dirfile(path, maxlen, root, tstr);
strcat(tstr, ".po");
BLI_path_append(path, maxlen, tstr);
- if (BLI_is_file(path))
+ if (BLI_is_file(path)) {
return;
+ }
}
}
@@ -1397,26 +1402,36 @@ static int edittranslation_exec(bContext *C, wmOperator *op)
ret = WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &ptr);
/* Clean up */
- if (but_label.strinfo)
+ if (but_label.strinfo) {
MEM_freeN(but_label.strinfo);
- if (rna_label.strinfo)
+ }
+ if (rna_label.strinfo) {
MEM_freeN(rna_label.strinfo);
- if (enum_label.strinfo)
+ }
+ if (enum_label.strinfo) {
MEM_freeN(enum_label.strinfo);
- if (but_tip.strinfo)
+ }
+ if (but_tip.strinfo) {
MEM_freeN(but_tip.strinfo);
- if (rna_tip.strinfo)
+ }
+ if (rna_tip.strinfo) {
MEM_freeN(rna_tip.strinfo);
- if (enum_tip.strinfo)
+ }
+ if (enum_tip.strinfo) {
MEM_freeN(enum_tip.strinfo);
- if (rna_struct.strinfo)
+ }
+ if (rna_struct.strinfo) {
MEM_freeN(rna_struct.strinfo);
- if (rna_prop.strinfo)
+ }
+ if (rna_prop.strinfo) {
MEM_freeN(rna_prop.strinfo);
- if (rna_enum.strinfo)
+ }
+ if (rna_enum.strinfo) {
MEM_freeN(rna_enum.strinfo);
- if (rna_ctxt.strinfo)
+ }
+ if (rna_ctxt.strinfo) {
MEM_freeN(rna_ctxt.strinfo);
+ }
return ret;
}
@@ -1544,8 +1559,9 @@ bool UI_drop_color_poll(struct bContext *C, wmDrag *drag, const wmEvent *UNUSED(
SpaceImage *sima = CTX_wm_space_image(C);
ARegion *ar = CTX_wm_region(C);
- if (UI_but_active_drop_color(C))
+ if (UI_but_active_drop_color(C)) {
return 1;
+ }
if (sima && (sima->mode == SI_MODE_PAINT) &&
sima->image && (ar && ar->regiontype == RGN_TYPE_WINDOW))
@@ -1589,14 +1605,16 @@ static int drop_color_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(
}
if (RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) {
- if (!gamma)
+ if (!gamma) {
IMB_colormanagement_scene_linear_to_srgb_v3(color);
+ }
RNA_property_float_set_array(&but->rnapoin, but->rnaprop, color);
RNA_property_update(C, &but->rnapoin, but->rnaprop);
}
else if (RNA_property_subtype(but->rnaprop) == PROP_COLOR) {
- if (gamma)
+ if (gamma) {
IMB_colormanagement_srgb_to_scene_linear_v3(color);
+ }
RNA_property_float_set_array(&but->rnapoin, but->rnaprop, color);
RNA_property_update(C, &but->rnapoin, but->rnaprop);
}