mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-03 08:51:30 -06:00
Each sheet gets an identity (gridcraft_model::SheetUid, Sheet::uid) for what must follow one sheet while sheets are inserted, deleted, moved or renamed, which a sheet index or a name can't do. It lives only while the app runs: it isn't saved to JSON or a file, and a new, inserted, copied or opened sheet gets a fresh one. A rename, a move and the copies undo keeps don't change it, so undo of a deletion brings back the same sheet. Sheets compare by content, whatever their identity: any two identities compare equal, and SheetUid::get compares them. sheet.move with copy gives the copy a fresh identity. Tests cover new sheets, clones, JSON, renames, moves, deletion and undo, copies and a workbook read from a file.