Previously the same functions were used to both set and get the active
state for outliner tree elements. This has quite a few problems.
- It's hard to tell when data is changed or simply read
- It prevents using const
- The code is full of if statements, making it longer and less readable.
This replaces the tree_element_type_active and tree_element_active
functions with _get and _set variants. One has const arguments and
returns the active state, the other deals only with setting the state.
While this refactor results in slightly more lines of code, the result
is much better in my opinion.
This commit also removes unused variables from arguments of the affected
functions.
I don't expect a full review of this, just a big picture yay or nay.
Note that there are a few places where it was necessary to cast away
const (in outliner_search_back and BKE_view_layer_base_find.
I think that's a fine trade-off. "const" variants of the two functions
could be created, but I don't think that's worth it.