Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-06-28 05:11:34 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-06-28 05:13:43 +0300
commit66054caa1b1ea55f778a0749c6b70339f9151d3a (patch)
tree9e85844849b8d4eeefc4e5cf6dbcf09e88101f38
parent3569ea03d8e6a5b8f9245e67064196e61c66d460 (diff)
RNA: perform reverse search on operators
In most the last added operator is being handles.
-rw-r--r--source/blender/makesrna/intern/rna_wm.c12
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;
}