diff options
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_draw.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 3c569a71e93..ce83cfc3c97 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -91,7 +91,7 @@ static void outliner_tree_dimensions_impl(SpaceOutliner *soops, int *width, int *height) { - for (TreeElement *te = lb->first; te; te = te->next) { + LISTBASE_FOREACH (TreeElement *, te, lb) { *width = MAX2(*width, te->xend); if (height != NULL) { *height += UI_UNIT_Y; @@ -387,8 +387,7 @@ static void outliner_collection_set_flag_recursive(Scene *scene, if (base_or_object_prop) { /* Note: We can't use BKE_collection_object_cache_get() * otherwise we would not take collection exclusion into account. */ - for (CollectionObject *cob = layer_collection->collection->gobject.first; cob; - cob = cob->next) { + LISTBASE_FOREACH (CollectionObject *, cob, &layer_collection->collection->gobject) { outliner_base_or_object_pointer_create(view_layer, collection, cob->ob, &ptr); RNA_property_boolean_set(&ptr, base_or_object_prop, value); @@ -401,7 +400,7 @@ static void outliner_collection_set_flag_recursive(Scene *scene, /* Keep going recursively. */ ListBase *lb = (layer_collection ? &layer_collection->layer_collections : &collection->children); - for (Link *link = lb->first; link; link = link->next) { + LISTBASE_FOREACH (Link *, link, lb) { LayerCollection *layer_collection_iter = layer_collection ? (LayerCollection *)link : NULL; Collection *collection_iter = layer_collection ? (collection ? layer_collection_iter->collection : NULL) : @@ -467,7 +466,7 @@ static bool outliner_collection_is_isolated(Scene *scene, /* Keep going recursively. */ ListBase *lb = (layer_collection ? &layer_collection->layer_collections : &collection->children); - for (Link *link = lb->first; link; link = link->next) { + LISTBASE_FOREACH (Link *, link, lb) { LayerCollection *layer_collection_iter = layer_collection ? (LayerCollection *)link : NULL; Collection *collection_iter = layer_collection ? (collection ? layer_collection_iter->collection : NULL) : @@ -542,8 +541,7 @@ void outliner_collection_isolate_flag(Scene *scene, /* Make this collection direct parents also "visible". */ if (layer_collection) { LayerCollection *lc_parent = layer_collection; - for (LayerCollection *lc_iter = top_layer_collection->layer_collections.first; lc_iter; - lc_iter = lc_iter->next) { + LISTBASE_FOREACH (LayerCollection *, lc_iter, &top_layer_collection->layer_collections) { if (BKE_layer_collection_has_layer_collection(lc_iter, layer_collection)) { lc_parent = lc_iter; break; @@ -555,8 +553,7 @@ void outliner_collection_isolate_flag(Scene *scene, scene, lc_parent, collection ? lc_parent->collection : NULL, &ptr); RNA_property_boolean_set(&ptr, layer_or_collection_prop, !is_hide); - for (LayerCollection *lc_iter = lc_parent->layer_collections.first; lc_iter; - lc_iter = lc_iter->next) { + LISTBASE_FOREACH (LayerCollection *, lc_iter, &lc_parent->layer_collections) { if (BKE_layer_collection_has_layer_collection(lc_iter, layer_collection)) { lc_parent = lc_iter; break; @@ -1054,7 +1051,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, /* Create buttons. */ uiBut *bt; - for (TreeElement *te = lb->first; te; te = te->next) { + LISTBASE_FOREACH (TreeElement *, te, lb) { TreeStoreElem *tselem = TREESTORE(te); RestrictPropertiesActive props_active = props_active_parent; @@ -1651,7 +1648,7 @@ static void outliner_draw_userbuts(uiBlock *block, ListBase *lb) { - for (TreeElement *te = lb->first; te; te = te->next) { + LISTBASE_FOREACH (TreeElement *, te, lb) { TreeStoreElem *tselem = TREESTORE(te); if (te->ys + 2 * UI_UNIT_Y >= region->v2d.cur.ymin && te->ys <= region->v2d.cur.ymax) { if (tselem->type == 0) { @@ -1770,7 +1767,7 @@ static void outliner_draw_rnabuts( PointerRNA *ptr; PropertyRNA *prop; - for (TreeElement *te = lb->first; te; te = te->next) { + LISTBASE_FOREACH (TreeElement *, te, lb) { TreeStoreElem *tselem = TREESTORE(te); if (te->ys + 2 * UI_UNIT_Y >= region->v2d.cur.ymin && te->ys <= region->v2d.cur.ymax) { if (tselem->type == TSE_RNA_PROPERTY) { @@ -2861,7 +2858,7 @@ static void outliner_draw_iconrow(bContext *C, { eOLDrawState active = OL_DRAWSEL_NONE; - for (TreeElement *te = lb->first; te; te = te->next) { + LISTBASE_FOREACH (TreeElement *, te, lb) { TreeStoreElem *tselem = TREESTORE(te); /* object hierarchy always, further constrained on level */ @@ -3204,7 +3201,7 @@ static void outliner_draw_tree_element(bContext *C, if (TSELEM_OPEN(tselem, soops)) { *starty -= UI_UNIT_Y; - for (TreeElement *ten = te->subtree.first; ten; ten = ten->next) { + LISTBASE_FOREACH (TreeElement *, ten, &te->subtree) { /* check if element needs to be drawn grayed out, but also gray out * childs of a grayed out parent (pass on draw_grayed_out to childs) */ bool draw_childs_grayed_out = draw_grayed_out || (ten->flag & TE_DRAGGING); @@ -3223,7 +3220,7 @@ static void outliner_draw_tree_element(bContext *C, } } else { - for (TreeElement *ten = te->subtree.first; ten; ten = ten->next) { + LISTBASE_FOREACH (TreeElement *, ten, &te->subtree) { outliner_set_coord_tree_element(ten, startx, *starty); } @@ -3357,7 +3354,7 @@ static void outliner_draw_struct_marks(ARegion *region, ListBase *lb, int *starty) { - for (TreeElement *te = lb->first; te; te = te->next) { + LISTBASE_FOREACH (TreeElement *, te, lb) { TreeStoreElem *tselem = TREESTORE(te); /* selection status */ @@ -3406,7 +3403,7 @@ static void outliner_draw_highlights_recursive(uint pos, const bool is_searching = (SEARCHING_OUTLINER(soops) || (soops->outlinevis == SO_DATA_API && soops->search_string[0] != 0)); - for (TreeElement *te = lb->first; te; te = te->next) { + LISTBASE_FOREACH (TreeElement *, te, lb) { const TreeStoreElem *tselem = TREESTORE(te); const int start_y = *io_start_y; @@ -3555,7 +3552,7 @@ static void outliner_draw_tree(bContext *C, // items themselves starty = (int)region->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET; startx = 0; - for (TreeElement *te = soops->tree.first; te; te = te->next) { + LISTBASE_FOREACH (TreeElement *, te, &soops->tree) { outliner_draw_tree_element(C, block, fstyle, |