From 51a7961e0984468e8ee6e5f9313e3884ba46d69d Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 19 Nov 2021 15:36:32 -0500 Subject: Cleanup: Simplify node editor link dragging storage Now that `node_intern.hh` is a C++ header, we can use C++ types there. This patch replaces the linked list of dragged links with a vector. Also, the list of drag operator custom data, `nldrag`, doesn't seem to need to be a list at all, so I just made it a unique pointer. Differential Revision: https://developer.blender.org/D13252 --- source/blender/editors/space_node/node_intern.hh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/space_node/node_intern.hh') diff --git a/source/blender/editors/space_node/node_intern.hh b/source/blender/editors/space_node/node_intern.hh index 436df70429b..2e973def867 100644 --- a/source/blender/editors/space_node/node_intern.hh +++ b/source/blender/editors/space_node/node_intern.hh @@ -49,13 +49,8 @@ struct wmWindow; /* temp data to pass on to modal */ struct bNodeLinkDrag { - struct bNodeLinkDrag *next, *prev; - - /* List of links dragged by the operator. - * NOTE: This is a list of LinkData structs on top of the actual bNodeLinks. - * This way the links can be added to the node tree while being stored in this list. - */ - ListBase links; + /** Links dragged by the operator. */ + blender::Vector links; bool from_multi_input_socket; int in_out; @@ -80,7 +75,7 @@ struct SpaceNode_Runtime { bool recalc; /** Temporary data for modal linking operator. */ - struct ListBase linkdrag; + std::unique_ptr linkdrag; /* XXX hack for translate_attach op-macros to pass data from transform op to insert_offset op */ /** Temporary data for node insert offset (in UI called Auto-offset). */ -- cgit v1.2.3