Fix T79162: 'prop_search' includes ID prefix in string properties

Regression from d6cefef98f

This also fixes an unreported issue where finding an exact match
wasn't being detected for items that contained an ID prefix.
This commit is contained in:
2020-07-23 17:24:17 +10:00
parent 4b31f4ace7
commit 67002402bd
11 changed files with 85 additions and 23 deletions

View File

@@ -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;
}
}
/**