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 <julian@blender.org>2020-09-21 15:57:32 +0300
committerJulian Eisel <julian@blender.org>2020-09-21 16:01:40 +0300
commit7883ccd29fe1dc37dff6c46ee0e9ba053444466d (patch)
treeeacbbdf46e516cf675c709faf33cc36288a69c1d /source/blender/editors
parent87d2ac96812fd30bcfcef34a8b78b9df8a72982e (diff)
Fix T80854: Search buttons fail in Adjust Last Operation Panel
There's the old and ugly hack where the `uiBut.poin` points to the button itself. When reallocating the button we have to update that pointer of course.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 2cb58c92449..8b149e2f97b 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -3988,12 +3988,16 @@ uiBut *ui_but_change_type(uiBut *but, eButType new_type)
const void *old_but_ptr = but;
/* Button may have pointer to a member within itself, this will have to be updated. */
const bool has_str_ptr_to_self = but->str == but->strdata;
+ const bool has_poin_ptr_to_self = but->poin == (char *)but;
but = MEM_recallocN_id(but, alloc_size, alloc_str);
but->type = new_type;
if (has_str_ptr_to_self) {
but->str = but->strdata;
}
+ if (has_poin_ptr_to_self) {
+ but->poin = (char *)but;
+ }
BLI_insertlinkafter(&but->block->buttons, insert_after_but, but);