diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-06-28 05:11:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-06-28 05:13:43 +0300 |
commit | 66054caa1b1ea55f778a0749c6b70339f9151d3a (patch) | |
tree | 9e85844849b8d4eeefc4e5cf6dbcf09e88101f38 /source | |
parent | 3569ea03d8e6a5b8f9245e67064196e61c66d460 (diff) |
RNA: perform reverse search on operators
In most the last added operator is being handles.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 0d11414c878..026d2e209a3 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -469,13 +469,15 @@ EnumPropertyItem rna_enum_wm_report_items[] = { static wmOperator *rna_OperatorProperties_find_operator(PointerRNA *ptr) { wmWindowManager *wm = ptr->id.data; - IDProperty *properties = (IDProperty *)ptr->data; - wmOperator *op; - if (wm) - for (op = wm->operators.first; op; op = op->next) - if (op->properties == properties) + if (wm) { + IDProperty *properties = (IDProperty *)ptr->data; + for (wmOperator *op = wm->operators.last; op; op = op->prev) { + if (op->properties == properties) { return op; + } + } + } return NULL; } |