mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-11 21:02:45 +00:00
Copying, pasting, deleting or releasing an anchored text frame left a document that Document::check rejects, so once saved it could not be opened again. - Copy and paste: copied text takes the stories of its anchored text frames along. Pasting text (also into another document) gives the anchored copies fresh ids and stories of their own (Document::adopt_anchored), and the text clipboard keeps a copy of the source document holding only those stories and the graphics the text and they place, which come along under the destination's asset ids (Document::adopt_anchored_from). A story shown by frames in several copied stories is copied once per paste and threads all their copies, as the original does, so shared stories don't multiply. Copied frames (clip_doc) keep the stories of their anchored frames too. - Document::fix_anchored_text_frames, run after edits and for new documents: copies with taken ids get fresh ones and stories of their own, deleted anchored frames leave their threads and their stories go with them, and a frame whose story is missing gets an empty one. - Release threads the released frame, under its new id, to its story. - The generated endnote story is set before the repair, and again when the repair changed anything: text with an anchored frame pasted into it is replaced, and the repair copies and removes stories with their endnotes. Duplicating and pasting frames already give anchored items fresh ids and story copies on main (#1522); this covers text copied with them, deletion and release.