mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
This commit is contained in:
1 parent
d7cd3d03b5
commit
06b5df9173
13 files changed
+448
-142
No files matched your search
@@ -22,9 +22,11 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
"path"
|
||||
"reflect"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -214,6 +216,19 @@ func (e *Editor) validate() error {
|
||||
// 入参: write 条目写入方法, progress 保存进度回调,预览时为nil
|
||||
// 返回: error 错误信息
|
||||
func (e *Editor) writeParts(write func(string, []byte, bool) error, progress editorProgress) error {
|
||||
if len(e.removedPages) != 0 {
|
||||
output := write
|
||||
write = func(name string, data []byte, binary bool) error {
|
||||
if !binary && strings.EqualFold(path.Ext(name), ".xml") {
|
||||
var err error
|
||||
data, err = pruneCreatedPageReferences(data, e.removedPages)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return output(name, data, binary)
|
||||
}
|
||||
}
|
||||
fonts, images, spaces, definitions := e.usedResources()
|
||||
writeXML := func(name string, encode func(*ofdXML)) error {
|
||||
data, err := encodeOFDXML(encode)
|
||||
|
||||
Reference in new issue
Block a user