mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 15:06:46 +08:00
This commit is contained in:
1 parent
19dc79e8e3
commit
a710bc5f41
68 files changed
+2149
-724
No files matched your search
@@ -120,7 +120,7 @@ func (r *Reader) extractedVersionRoot(ctx context.Context, version DocumentVersi
|
||||
return nil, err
|
||||
}
|
||||
body := root.childAt("DocBody", r.documentIndex)
|
||||
if body == nil || body.child("DocRoot") == nil {
|
||||
if body == nil {
|
||||
return nil, fmt.Errorf("document entry not found: %d", r.documentIndex)
|
||||
}
|
||||
var patches []editorXMLPatch
|
||||
@@ -133,9 +133,17 @@ func (r *Reader) extractedVersionRoot(ctx context.Context, version DocumentVersi
|
||||
}
|
||||
}
|
||||
entry := body.child("DocRoot")
|
||||
patches = append(patches, editorXMLContent(data, entry, editorFontXMLText(version.DocRoot)))
|
||||
if entry != nil {
|
||||
patches = append(patches, editorXMLContent(data, entry, editorFontXMLText(version.DocRoot)))
|
||||
}
|
||||
if versions := body.child("Versions"); versions != nil {
|
||||
patches = append(patches, editorXMLPatch{start: versions.start, end: versions.end})
|
||||
var replacement []byte
|
||||
if entry == nil {
|
||||
replacement = body.textXML("DocRoot", version.DocRoot)
|
||||
}
|
||||
patches = append(patches, editorXMLPatch{versions.start, versions.end, replacement})
|
||||
} else if entry == nil {
|
||||
return nil, fmt.Errorf("document entry not found: %d", r.documentIndex)
|
||||
}
|
||||
references := []*editorXML{body.child("Signatures")}
|
||||
if info := body.child("DocInfo"); info != nil {
|
||||
|
||||
Reference in new issue
Block a user