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:
authorJulian Eisel <eiseljulian@gmail.com>2017-05-05 13:44:52 +0300
committerJulian Eisel <eiseljulian@gmail.com>2017-05-05 13:44:52 +0300
commit8b8792e7b8aa04c33d2b57c79a6d24bf03b699fb (patch)
tree575027326d925d9e2028ce7c24f384d48a0bd067 /source/blender/editors/interface/interface_regions.c
parenta7388d650a8b0045aee680ca38cc02fc021ebbc3 (diff)
parent5b6838129f022102518b7cd8cabec3823c3749a8 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/interface/interface_regions.c')
-rw-r--r--source/blender/editors/interface/interface_regions.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index b1f3482e109..ed8c3a50875 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -813,11 +813,11 @@ int UI_searchbox_size_x(void)
return 12 * UI_UNIT_X;
}
-int UI_search_items_find_index(uiSearchItems *items, const char *name, const size_t offset)
+int UI_search_items_find_index(uiSearchItems *items, const char *name)
{
int i;
for (i = 0; i < items->totitem; i++) {
- if (STREQ(name, items->names[i] + offset)) {
+ if (STREQ(name, items->names[i])) {
return i;
}
}
@@ -896,7 +896,7 @@ static void ui_searchbox_butrect(rcti *r_rect, uiSearchboxData *data, int itemnr
int ui_searchbox_find_index(ARegion *ar, const char *name)
{
uiSearchboxData *data = ar->regiondata;
- return UI_search_items_find_index(&data->items, name, 0);
+ return UI_search_items_find_index(&data->items, name);
}
/* x and y in screencoords */
@@ -1425,14 +1425,14 @@ void ui_searchbox_free(bContext *C, ARegion *ar)
/* sets red alert if button holds a string it can't find */
/* XXX weak: search_func adds all partial matches... */
-void ui_but_search_refresh(uiBut *but, const bool is_template_ID)
+void ui_but_search_refresh(uiBut *but)
{
uiSearchItems *items;
int x1;
- /* possibly very large lists (such as ID datablocks),
- * only validate string and pointer RNA buts */
- if (but->rnaprop && !ELEM(RNA_property_type(but->rnaprop), PROP_STRING, PROP_POINTER)) {
+ /* possibly very large lists (such as ID datablocks) only
+ * only validate string RNA buts (not pointers) */
+ if (but->rnaprop && RNA_property_type(but->rnaprop) != PROP_STRING) {
return;
}
@@ -1452,8 +1452,7 @@ void ui_but_search_refresh(uiBut *but, const bool is_template_ID)
UI_but_flag_enable(but, UI_BUT_REDALERT);
}
else if (items->more == 0) {
- const size_t offset = is_template_ID ? 3 : 0;
- if (UI_search_items_find_index(items, but->drawstr, offset) == -1) {
+ if (UI_search_items_find_index(items, but->drawstr) == -1) {
UI_but_flag_enable(but, UI_BUT_REDALERT);
}
}