Fix (unreported): crash on undo when using pinned id in spreadsheet

Now the behavior is the same as in the properties editor, as far as I can tell.
This commit is contained in:
Jacques Lucke 2021-03-11 13:28:06 +01:00
parent fade765bf3
commit d4d03f736b
2 changed files with 7 additions and 1 deletions

View File

@ -24,7 +24,7 @@ class SPREADSHEET_OT_toggle_pin(bpy.types.Operator):
'''Turn on or off pinning'''
bl_idname = "spreadsheet.toggle_pin"
bl_label = "Toggle Pin"
bl_options = {'REGISTER', 'UNDO'}
bl_options = {'REGISTER'}
@classmethod
def poll(cls, context):

View File

@ -2985,6 +2985,12 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map,
sclip->scopes.ok = 0;
}
else if (sl->spacetype == SPACE_SPREADSHEET) {
SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)sl;
sspreadsheet->pinned_id = restore_pointer_by_name(
id_map, sspreadsheet->pinned_id, USER_IGNORE);
}
}
}
}