1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-05 07:40:24 +08:00

add AddShape api

This commit is contained in:
源文雨
2023-02-27 16:12:56 +08:00
parent c8aae913f2
commit d19032acad
11 changed files with 211 additions and 23 deletions

View File

@@ -98,7 +98,7 @@ type WPSSpPr struct {
Xfrm AXfrm
PrstGeom APrstGeom
NoFill *struct{} `xml:"a:noFill,omitempty"`
Ln *ALine
Elems []interface{}
}
// UnmarshalXML ...
@@ -132,11 +132,12 @@ func (w *WPSSpPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
case "noFill":
w.NoFill = &struct{}{}
case "ln":
w.Ln = &ALine{}
err = d.DecodeElement(&w.Ln, &tt)
var ln ALine
err = d.DecodeElement(&ln, &tt)
if err != nil && !strings.HasPrefix(err.Error(), "expected") {
return err
}
w.Elems = append(w.Elems, &ln)
default:
err = d.Skip() // skip unsupported tags
if err != nil {