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

完善 wpg

This commit is contained in:
源文雨
2023-03-03 21:22:01 +08:00
parent 6e7f6b743b
commit 5091de63b8
4 changed files with 265 additions and 20 deletions

View File

@@ -215,7 +215,26 @@ func (w *WPSCNvSpPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err e
// ASPLocks represents the locks applied to a shape.
type ASPLocks struct {
XMLName xml.Name `xml:"a:spLocks,omitempty"`
XMLName xml.Name `xml:"a:spLocks,omitempty"`
NoChangeArrowheads int `xml:"noChangeArrowheads,attr,omitempty"`
}
// UnmarshalXML ...
func (l *ASPLocks) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) {
for _, attr := range start.Attr {
switch attr.Name.Local {
case "noChangeArrowheads":
l.NoChangeArrowheads, err = strconv.Atoi(attr.Value)
if err != nil {
return err
}
default:
// ignore other attributes
}
}
// Consume the end element
_, err = d.Token()
return err
}
// WPSSpPr is a container element that represents the visual properties of a shape.