mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 15:31:49 +08:00
1 parent
444c01b976
commit
e9caaa4193
31 files changed
+639
-182
No files matched your search
@@ -62,8 +62,10 @@ func (e *Editor) SetDocumentActions(actions []Action) error {
|
||||
return err
|
||||
}
|
||||
patch := editorXMLPatch{root.close, root.close, encoded}
|
||||
context := root
|
||||
if node := root.child("Actions"); node != nil {
|
||||
patch.start, patch.end = node.start, node.end
|
||||
context = node
|
||||
} else {
|
||||
for _, child := range root.children {
|
||||
if packageOFDNode(child, child.name.Local) && slices.Contains([]string{"VPreferences", "Bookmarks", "Annotations", "CustomTags", "Attachments", "Extensions"}, child.name.Local) {
|
||||
@@ -72,6 +74,10 @@ func (e *Editor) SetDocumentActions(actions []Action) error {
|
||||
}
|
||||
}
|
||||
}
|
||||
patch.data, err = editorXMLGenerated(encoded, context.name.Space)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return e.commitAnnotationParts(base, map[string][]byte{name: editorPatchXML(data, []editorXMLPatch{patch})})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user