diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-07-23 10:24:17 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-07-23 10:24:17 +0300 |
commit | 67002402bd60d701acaf9e22801bc4411ded21d7 (patch) | |
tree | 7f48c668c1ee2b018374a899a8932a0c0d7f6922 /source/blender/blenkernel | |
parent | 4b31f4ace70c8a9d2117f60e6fdf6c3448eae3f5 (diff) |
Fix T79162: 'prop_search' includes ID prefix in string properties
Regression from d6cefef98f87a
This also fixes an unreported issue where finding an exact match
wasn't being detected for items that contained an ID prefix.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_lib_id.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_id.c | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h index 76bae6fa909..d46a03e90af 100644 --- a/source/blender/blenkernel/BKE_lib_id.h +++ b/source/blender/blenkernel/BKE_lib_id.h @@ -267,7 +267,8 @@ void BKE_id_full_name_get(char name[MAX_ID_FULL_NAME], const struct ID *id, char void BKE_id_full_name_ui_prefix_get(char name[MAX_ID_FULL_NAME_UI], const struct ID *id, const bool add_lib_hint, - char separator_char); + char separator_char, + int *r_prefix_len); char *BKE_id_to_unique_string_key(const struct ID *id); diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c index eb440de1a6f..a64e550579d 100644 --- a/source/blender/blenkernel/intern/lib_id.c +++ b/source/blender/blenkernel/intern/lib_id.c @@ -2161,7 +2161,7 @@ void BKE_id_full_name_get(char name[MAX_ID_FULL_NAME], const ID *id, char separa /** * Generate full name of the data-block (without ID code, but with library if any), - * with a 3-character prefix prepended indicating whether it comes from a library, + * with a 2 to 3 character prefix prepended indicating whether it comes from a library, * is overriding, has a fake or no user, etc. * * \note Result is unique to a given ID type in a given Main database. @@ -2170,11 +2170,13 @@ void BKE_id_full_name_get(char name[MAX_ID_FULL_NAME], const ID *id, char separa * will be filled with generated string. * \param separator_char: Character to use for separating name and library name. Can be 0 to use * default (' '). + * \param r_prefix_len: The length of the prefix added. */ void BKE_id_full_name_ui_prefix_get(char name[MAX_ID_FULL_NAME_UI], const ID *id, const bool add_lib_hint, - char separator_char) + char separator_char, + int *r_prefix_len) { int i = 0; @@ -2185,6 +2187,10 @@ void BKE_id_full_name_ui_prefix_get(char name[MAX_ID_FULL_NAME_UI], name[i++] = ' '; BKE_id_full_name_get(name + i, id, separator_char); + + if (r_prefix_len) { + *r_prefix_len = i; + } } /** |