diff options
author | Julian Eisel <julian@blender.org> | 2022-01-26 20:02:33 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-01-26 21:15:57 +0300 |
commit | b57db4b79ed25f07176474b864d698ef48578f42 (patch) | |
tree | 73bbf756ae938b68a15a12ad9404b9c47092b111 /source/blender/editors/space_outliner/outliner_draw.cc | |
parent | fc0dd5583c3132cde4208bc8944469a92a601c62 (diff) |
Cleanup: Reduce `void *` reliance of new RNA C++ Outliner elements
Continuation of the previous commit, this time addressing the same for
RNA tree-elements.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_draw.cc')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc index 6de8d9539a9..1b64efd0088 100644 --- a/source/blender/editors/space_outliner/outliner_draw.cc +++ b/source/blender/editors/space_outliner/outliner_draw.cc @@ -81,6 +81,7 @@ #include "outliner_intern.hh" #include "tree/tree_display.hh" #include "tree/tree_element.hh" +#include "tree/tree_element_rna.hh" using namespace blender::ed::outliner; @@ -1915,9 +1916,9 @@ static void outliner_draw_rnabuts( 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) { + if (TreeElementRNAProperty *te_rna_prop = tree_element_cast<TreeElementRNAProperty>(te)) { ptr = &te->rnaptr; - prop = reinterpret_cast<PropertyRNA *>(te->directdata); + prop = te_rna_prop->getRNAProperty(); if (!TSELEM_OPEN(tselem, space_outliner)) { if (RNA_property_type(prop) == PROP_POINTER) { @@ -1959,9 +1960,10 @@ static void outliner_draw_rnabuts( } } } - else if (tselem->type == TSE_RNA_ARRAY_ELEM) { + else if (TreeElementRNAArrayElement *te_rna_array_elem = + tree_element_cast<TreeElementRNAArrayElement>(te)) { ptr = &te->rnaptr; - prop = reinterpret_cast<PropertyRNA *>(te->directdata); + prop = te_rna_array_elem->getRNAProperty(); uiDefAutoButR(block, ptr, |