mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
This commit is contained in:
1 parent
ed11ade4e8
commit
a8346a6006
23 files changed
+2297
-104
No files matched your search
+1
-22
@@ -18,7 +18,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"maps"
|
||||
"path"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -284,25 +283,5 @@ func (e *Editor) editAnnotations(index int, ids []string, edit func([]byte, *edi
|
||||
if len(parts) == 0 {
|
||||
return nil
|
||||
}
|
||||
files := maps.Clone(reader.files)
|
||||
if files == nil {
|
||||
files = make(map[string][]byte)
|
||||
}
|
||||
maps.Copy(files, parts)
|
||||
updated := &Reader{Zip: reader.Zip, files: files}
|
||||
if err := updated.initRoot(); err != nil {
|
||||
return err
|
||||
}
|
||||
doc, err := updated.Doc()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
before, after := e.source, *e.source
|
||||
after.reader, after.document = updated, doc
|
||||
e.source = &after
|
||||
if change := e.recordChange(); change != nil {
|
||||
change.undo = func(e *Editor) { e.source = before }
|
||||
change.redo = func(e *Editor) { e.source = &after }
|
||||
}
|
||||
return nil
|
||||
return e.commitAnnotationParts(e.source, parts)
|
||||
}
|
||||
Reference in new issue
Block a user