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:
authorJulian Eisel <julian@blender.org>2021-03-05 19:38:53 +0300
committerJulian Eisel <julian@blender.org>2021-03-05 19:46:33 +0300
commitb9e54566e3b1a49d9757680da64d8e19c136c706 (patch)
tree2888ae7a1c41eab1467995a569218f5cdc413f70 /source/blender/editors/space_outliner/outliner_context.c
parented84161529527274852d5665f93a7d8b7cd1be9c (diff)
Cleanup: Add & use enum value for ID Outliner element type
Code to check if the Outliner tree-element type was the general ID one would always check against "0" (explicity or even implicitly). For somebody unfamiliar with the code this is very confusing. Instead the value should be given a name, e.g. through an enum. Adds `TSE_SOME_ID` as the "default" ID tree-element type. Other types may still represent IDs, as I explained in a comment at the definition. There may also still be cases where the type is checked against "0". I noted in the comment that such cases should be cleaned up if found.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_context.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_context.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_context.c b/source/blender/editors/space_outliner/outliner_context.c
index e2b3b79e027..4293d8da73e 100644
--- a/source/blender/editors/space_outliner/outliner_context.c
+++ b/source/blender/editors/space_outliner/outliner_context.c
@@ -34,7 +34,7 @@ static void outliner_context_selected_ids_recursive(const ListBase *subtree,
{
LISTBASE_FOREACH (const TreeElement *, te, subtree) {
const TreeStoreElem *tse = TREESTORE(te);
- if ((tse->flag & TSE_SELECTED) && (ELEM(tse->type, 0, TSE_LAYER_COLLECTION))) {
+ if ((tse->flag & TSE_SELECTED) && (ELEM(tse->type, TSE_SOME_ID, TSE_LAYER_COLLECTION))) {
CTX_data_id_list_add(result, tse->id);
}
outliner_context_selected_ids_recursive(&te->subtree, result);