From 5d6166215411a6401b1186d6623c91285a14cd99 Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Wed, 21 Oct 2026 16:05:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=86=99=E5=85=A5=E8=83=BD=E5=8A=9B):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BF=9D=E5=AD=98=E5=BF=AB=E7=85=A7=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ofdgo_writer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ofdgo_writer.go b/ofdgo_writer.go index cdc2722..6af2a6b 100644 --- a/ofdgo_writer.go +++ b/ofdgo_writer.go @@ -109,7 +109,7 @@ type ofdXML struct { type ofdAttrs []xml.Attr // Snapshot 创建独立编辑快照,完成后可与原编辑器并行使用 -// 创建过程需与原实例串行,保留修订及保存目标,不复制撤销记录和进度回调 +// 创建过程需与原实例串行,保留修订、附件清理状态及保存目标,不复制撤销记录和进度回调 // 保存目标与原实例共享,由输出实现协调并发事务及提交版本 // 原包压缩数据独立复制并在快照间复用,超预算数据随最后一个快照释放 // 自定义后端及字体文件系统仍由调用方提供,需支持并行读取 @@ -146,6 +146,10 @@ func (e *Editor) Snapshot(ctx context.Context) (*Editor, error) { } snapshot.revision, snapshot.serial, snapshot.saveTarget = e.revision, e.serial, e.saveTarget snapshot.backends, snapshot.fontDirs, snapshot.fontFS = e.backends, slices.Clone(e.fontDirs), slices.Clone(e.fontFS) + if e.source != nil { + snapshot.source.retiredAttachments = maps.Clone(e.source.retiredAttachments) + snapshot.source.removedAttachments = maps.Clone(e.source.removedAttachments) + } return snapshot, nil }