diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 7a61ef2abac..bc47cfde143 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -258,6 +258,16 @@ void BKE_blender_userdef_app_template_data_swap(UserDef *userdef_a, UserDef *use SWAP(ListBase, userdef_a->id, userdef_b->id); \ } ((void)0) +#define FLAG_SWAP(id, ty, flags) { \ + CHECK_TYPE(&(userdef_a->id), ty *); \ + const ty f = flags; \ + const ty a = userdef_a->id; \ + const ty b = userdef_b->id; \ + userdef_a->id = (userdef_a->id & ~f) | (b & f); \ + userdef_b->id = (userdef_b->id & ~f) | (a & f); \ +} ((void)0) + + LIST_SWAP(uistyles); LIST_SWAP(uifonts); LIST_SWAP(themes); @@ -270,9 +280,11 @@ void BKE_blender_userdef_app_template_data_swap(UserDef *userdef_a, UserDef *use DATA_SWAP(font_path_ui_mono); DATA_SWAP(keyconfigstr); -#undef SWAP_TYPELESS -#undef LIST_SWAP + FLAG_SWAP(uiflag, int, USER_LOCK_UI_LAYOUT); + #undef DATA_SWAP +#undef LIST_SWAP +#undef FLAG_SWAP } void BKE_blender_userdef_app_template_data_set(UserDef *userdef) |