mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +08:00
1 parent
f024eff35d
commit
ddf0dda283
1 file changed
+2
-15
@@ -17,7 +17,6 @@ package ofdgo
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/xml"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"image"
|
"image"
|
||||||
"path"
|
"path"
|
||||||
@@ -386,23 +385,11 @@ func invalidateResourcePreviews(ctx context.Context, scan *editorFontDocument, i
|
|||||||
changed = changed || affected[editorResourceID(node.attr("Relative"))]
|
changed = changed || affected[editorResourceID(node.attr("Relative"))]
|
||||||
}
|
}
|
||||||
if node.matchesOFD("ImageObject") && primary && node.hasAttr("Substitution") {
|
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 {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
var object ImageObject
|
patches = append(patches, patch)
|
||||||
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
|
|
||||||
}
|
}
|
||||||
for _, child := range node.children {
|
for _, child := range node.children {
|
||||||
used, err := visit(child)
|
used, err := visit(child)
|
||||||
|
|||||||
Reference in new issue
Block a user