code cleanup: favor braces when blocks have mixed brace use.
[blender.git] / source / blender / editors / interface / interface_templates.c
index a922715..9cc45f5 100644 (file)
@@ -281,7 +281,9 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
                                if (id->flag & LIB_FAKEUSER) id_us_plus(id);
                                else id_us_min(id);
                        }
-                       else return;
+                       else {
+                               return;
+                       }
                        break;
                case UI_ID_LOCAL:
                        if (id) {
@@ -1048,9 +1050,8 @@ static void do_constraint_panels(bContext *C, void *ob_pt, int event)
                case B_CONSTRAINT_CHANGETARGET:
                {
                        Main *bmain = CTX_data_main(C);
-                       Scene *scene = CTX_data_scene(C);
                        if (ob->pose) ob->pose->flag |= POSE_RECALC;  /* checks & sorts pose channels */
-                       DAG_scene_sort(bmain, scene);
+                       DAG_relations_tag_update(bmain);
                        break;
                }
 #endif
@@ -1581,7 +1582,8 @@ static uiBlock *icon_view_menu(bContext *C, ARegion *ar, void *arg_litem)
        /* arg_litem is malloced, can be freed by parent button */
        cb = *((RNAUpdateCb *)arg_litem);
        
-       icon = RNA_property_enum_get(&cb.ptr, cb.prop);
+       /* unused */
+       // icon = RNA_property_enum_get(&cb.ptr, cb.prop);
        
        block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
        uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW);
@@ -1679,7 +1681,7 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname
 
        hist = (Histogram *)cptr.data;
 
-       hist->height = (hist->height <= UI_UNIT_Y) ? UI_UNIT_Y : hist->height;
+       hist->height = (hist->height <= 20) ? 20 : hist->height;
 
        bt = uiDefBut(block, HISTOGRAM, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect), UI_DPI_FAC * hist->height,
                      hist, 0, 0, 0, 0, "");
@@ -1718,7 +1720,7 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
        
        block = uiLayoutAbsoluteBlock(layout);
        
-       scopes->wavefrm_height = (scopes->wavefrm_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->wavefrm_height;
+       scopes->wavefrm_height = (scopes->wavefrm_height <= 20) ? 20 : scopes->wavefrm_height;
 
        bt = uiDefBut(block, WAVEFORM, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect), UI_DPI_FAC * scopes->wavefrm_height,
                      scopes, 0, 0, 0, 0, "");
@@ -1756,7 +1758,7 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propna
        
        block = uiLayoutAbsoluteBlock(layout);
 
-       scopes->vecscope_height = (scopes->vecscope_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->vecscope_height;
+       scopes->vecscope_height = (scopes->vecscope_height <= 20) ? 20 : scopes->vecscope_height;
        
        bt = uiDefBut(block, VECTORSCOPE, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect),
                      UI_DPI_FAC * scopes->vecscope_height, scopes, 0, 0, 0, 0, "");
@@ -2585,7 +2587,8 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co
 
                /* if list length changes and active is out of view, scroll to it */
                if ((ui_list->list_last_len != len) &&
-                   (activei < ui_list->list_scroll || activei >= ui_list->list_scroll + items)) {
+                   (activei < ui_list->list_scroll || activei >= ui_list->list_scroll + items))
+               {
                        ui_list->list_scroll = activei;
                }
 
@@ -2717,7 +2720,7 @@ static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char
 {
        GHashIterator *iter = WM_operatortype_iter();
 
-       for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+       for (; BLI_ghashIterator_notDone(iter); BLI_ghashIterator_step(iter)) {
                wmOperatorType *ot = BLI_ghashIterator_getValue(iter);
 
                if ((ot->flag & OPTYPE_INTERNAL) && (G.debug & G_DEBUG_WM) == 0)