1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-09 01:30:25 +08:00

fix: cannot open in word

This commit is contained in:
源文雨
2023-02-21 16:12:20 +08:00
parent 6ba1fa9485
commit d2666ec617
16 changed files with 583 additions and 68 deletions

View File

@@ -73,12 +73,11 @@ func (r *Run) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
// RunProperties encapsulates visual properties of a run
type RunProperties struct {
XMLName xml.Name `xml:"w:rPr,omitempty"`
Color *Color `xml:"w:color,omitempty"`
Size *Size `xml:"w:sz,omitempty"`
RunStyle *RunStyle `xml:"w:rStyle,omitempty"`
Style *Style `xml:"w:pStyle,omitempty"`
Justification *Justification `xml:"w:jc,omitempty"`
XMLName xml.Name `xml:"w:rPr,omitempty"`
Color *Color `xml:"w:color,omitempty"`
Size *Size `xml:"w:sz,omitempty"`
RunStyle *RunStyle `xml:"w:rStyle,omitempty"`
Style *Style `xml:"w:pStyle,omitempty"`
}
func (r *RunProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
@@ -110,10 +109,6 @@ func (r *RunProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) err
var value Style
value.Val = getAtt(tt.Attr, "val")
r.Style = &value
case "jc":
var value Justification
value.Val = getAtt(tt.Attr, "val")
r.Justification = &value
default:
continue
}