diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-22 11:27:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-22 11:27:45 +0300 |
commit | e31d0198e67b28d925ee8164efe8971dba8721b1 (patch) | |
tree | b68a822cb21e44b6ccc67cbf9833cd13a3c6d321 /source/blender/editors/interface | |
parent | 2bfee787a6b2a8884344ef4ef460a4f83da8262d (diff) |
exclude self references from the ID search list when PROP_ID_SELF_CHECK is set, also raise an error from python if this is attempted
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 313e7b67183..0c44b15296a 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -157,16 +157,19 @@ static void id_search_cb(const bContext *C, void *arg_template, char *str, uiSea { TemplateID *template= (TemplateID*)arg_template; ListBase *lb= template->idlb; - ID *id; + ID *id, *id_from= template->ptr.id.data; int iconid; + int flag= RNA_property_flag(template->prop); /* ID listbase */ for(id= lb->first; id; id= id->next) { - if(BLI_strcasestr(id->name+2, str)) { - iconid= ui_id_icon_get((bContext*)C, id, 0); + if(!((flag & PROP_ID_SELF_CHECK) && id == id_from)) { + if(BLI_strcasestr(id->name+2, str)) { + iconid= ui_id_icon_get((bContext*)C, id, 0); - if(!uiSearchItemAdd(items, id->name+2, id, iconid)) - break; + if(!uiSearchItemAdd(items, id->name+2, id, iconid)) + break; + } } } } |