Add missing element `xfId` of the styles to fix issue #93.

This commit is contained in:
Ri Xu 2017-08-07 10:42:10 +08:00
parent 6626a26f7b
commit 5cf3725f02
No known key found for this signature in database
GPG Key ID: BA5E5BB1C948EDF7
2 changed files with 3 additions and 1 deletions

View File

@ -2122,6 +2122,8 @@ func setCellXfs(style *xlsxStyleSheet, fontID, numFmtID, fillID, borderID int, a
style.CellXfs.Count++
xf.Alignment = alignment
xf.ApplyAlignment = applyAlignment
xfID := 0
xf.XfID = &xfID
style.CellXfs.Xf = append(style.CellXfs.Xf, xf)
return style.CellXfs.Count - 1
}

View File

@ -211,7 +211,7 @@ type xlsxXf struct {
NumFmtID int `xml:"numFmtId,attr"`
PivotButton bool `xml:"pivotButton,attr,omitempty"`
QuotePrefix bool `xml:"quotePrefix,attr,omitempty"`
XfID *int `xml:"xfId,attr,omitempty"`
XfID *int `xml:"xfId,attr"`
Alignment *xlsxAlignment `xml:"alignment"`
Protection *xlsxProtection `xml:"protection"`
}