diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-12-18 05:59:49 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-12-18 05:59:49 +0300 |
commit | 7cbcfb7f492d027d415326d3b100803e949ce84a (patch) | |
tree | b11f5db1984437596c716ffeb381788c0075b716 | |
parent | f880fe2d66f1975880c21401246a5ff48f479314 (diff) |
Cleanup: Use LISTBASE_FOREACH macro in outliner code
No functional changes.
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_edit.c | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 6364fbc0a87..657ada874ea 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -2928,8 +2928,6 @@ static void outliner_draw_iconrow(bContext *C, /* closed tree element */ static void outliner_set_coord_tree_element(TreeElement *te, int startx, int starty) { - TreeElement *ten; - /* closed items may be displayed in row of parent, don't change their coordinate! */ if ((te->flag & TE_ICONROW) == 0 && (te->flag & TE_ICONROW_MERGED) == 0) { te->xs = 0; @@ -2937,7 +2935,7 @@ static void outliner_set_coord_tree_element(TreeElement *te, int startx, int sta te->xend = 0; } - for (ten = te->subtree.first; ten; ten = ten->next) { + LISTBASE_FOREACH (TreeElement *, ten, &te->subtree) { outliner_set_coord_tree_element(ten, startx + UI_UNIT_X, starty); } } diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index a1ff6193cd0..1cb98e704f2 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -1253,8 +1253,7 @@ static void outliner_set_coordinates_element_recursive(SpaceOutliner *space_outl *starty -= UI_UNIT_Y; if (TSELEM_OPEN(tselem, space_outliner)) { - TreeElement *ten; - for (ten = te->subtree.first; ten; ten = ten->next) { + LISTBASE_FOREACH (TreeElement *, ten, &te->subtree) { outliner_set_coordinates_element_recursive(space_outliner, ten, startx + UI_UNIT_X, starty); } } @@ -1753,7 +1752,7 @@ static void tree_element_to_path(TreeElement *te, { ListBase hierarchy = {NULL, NULL}; LinkData *ld; - TreeElement *tem, *temnext, *temsub; + TreeElement *tem, *temnext; TreeStoreElem *tse /* , *tsenext */ /* UNUSED */; PointerRNA *ptr, *nextptr; PropertyRNA *prop; @@ -1823,7 +1822,7 @@ static void tree_element_to_path(TreeElement *te, /* otherwise use index */ int index = 0; - for (temsub = tem->subtree.first; temsub; temsub = temsub->next, index++) { + LISTBASE_FOREACH (TreeElement *, temsub, &tem->subtree) { if (temsub == temnext) { break; } |