mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +08:00
1 parent
8de701dbd4
commit
d37f41cd90
21 files changed
+280
-57
No files matched your search
@@ -65,7 +65,7 @@ func (e *Editor) AddAttachment(name string, data []byte) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
entry = bytes.TrimPrefix(entry, []byte(xml.Header))
|
||||
docName := cleanPackagePath(base.reader.OFD.DocBody[0].DocRoot)
|
||||
docName := cleanPackagePath(base.reader.OFD.DocBody[base.reader.documentIndex].DocRoot)
|
||||
docData, err := base.reader.readFile(docName)
|
||||
if err != nil {
|
||||
return "", err
|
||||
@@ -190,7 +190,7 @@ func (e *Editor) editAttachment(id string, change func([]byte, *editorXML, map[s
|
||||
if base == nil {
|
||||
return fmt.Errorf("attachment not found: %s", id)
|
||||
}
|
||||
name := cleanPackagePath(base.reader.OFD.DocBody[0].DocRoot)
|
||||
name := cleanPackagePath(base.reader.OFD.DocBody[base.reader.documentIndex].DocRoot)
|
||||
external := strings.TrimSpace(base.document.Attachments.Path) != ""
|
||||
if external {
|
||||
name = base.reader.ResPath(base.document.Attachments.Path)
|
||||
|
||||
Reference in new issue
Block a user