mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
1 parent
f024eff35d
commit
ddf0dda283
1 file changed
+2
-15
@@ -17,7 +17,6 @@ package ofdgo
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"image"
|
||||
"path"
|
||||
@@ -386,23 +385,11 @@ func invalidateResourcePreviews(ctx context.Context, scan *editorFontDocument, i
|
||||
changed = changed || affected[editorResourceID(node.attr("Relative"))]
|
||||
}
|
||||
if node.matchesOFD("ImageObject") && primary && node.hasAttr("Substitution") {
|
||||
fragment, err := editorXMLStandalone(data[node.start:node.end], node)
|
||||
patch, err := editorXMLAttributeChange(data, node, "Substitution", nil)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
var object ImageObject
|
||||
if err := xml.Unmarshal(fragment, &object); err != nil {
|
||||
return false, err
|
||||
}
|
||||
before := GraphicObject{Type: "ImageObject", ImageObject: object}
|
||||
after := before
|
||||
after.ImageObject.Substitution = ""
|
||||
updated, err := editorXMLObject(data, node, before, after)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
patches = append(patches, editorXMLPatch{node.start, node.end, updated})
|
||||
return true, nil
|
||||
patches = append(patches, patch)
|
||||
}
|
||||
for _, child := range node.children {
|
||||
used, err := visit(child)
|
||||
|
||||
Reference in new issue
Block a user