mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-24 10:08:00 -06:00
From review. When undo restores security from before the last save, the save now goes onto the newest file of this session that has the snapshot's security and continues its source, not only the source itself. An edit saved before the security change keeps its revision; only revisions in the other security, all undone, are dropped. save_bytes compares the saved file's security, recorded at mark_saved as a SecurityIdentity (dictionary and, below revision 5, first /ID), before opening anything. The chosen file is opened with the snapshot's key, so a password that no longer opens the last save can't fail it. One early return covers a snapshot that is its target unchanged. overlay_changes_from keeps reading this file under its own /Encrypt number and records the snapshot's only for writing, and refuses a document with a pending security change.