diff options
author | Julian Eisel <julian@blender.org> | 2020-09-21 15:57:32 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-09-21 16:01:40 +0300 |
commit | 7883ccd29fe1dc37dff6c46ee0e9ba053444466d (patch) | |
tree | eacbbdf46e516cf675c709faf33cc36288a69c1d /source | |
parent | 87d2ac96812fd30bcfcef34a8b78b9df8a72982e (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')
-rw-r--r-- | source/blender/editors/interface/interface.c | 4 |
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); |