[Bf-blender-cvs] [66054ca] master: RNA: perform reverse search on operators
Campbell Barton
noreply at git.blender.org
Tue Jun 28 04:14:02 CEST 2016
Commit: 66054caa1b1ea55f778a0749c6b70339f9151d3a
Author: Campbell Barton
Date: Tue Jun 28 12:11:34 2016 +1000
Branches: master
https://developer.blender.org/rB66054caa1b1ea55f778a0749c6b70339f9151d3a
RNA: perform reverse search on operators
In most the last added operator is being handles.
===================================================================
M source/blender/makesrna/intern/rna_wm.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 0d11414..026d2e2 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;
}
More information about the Bf-blender-cvs
mailing list