From 5cf3725f026d2a1dbf3208d575ade996cfd7e7ec Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Mon, 7 Aug 2017 10:42:10 +0800 Subject: [PATCH] Add missing element `xfId` of the styles to fix issue #93. --- styles.go | 2 ++ xmlStyles.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/styles.go b/styles.go index 2e440c2..b359313 100644 --- a/styles.go +++ b/styles.go @@ -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 } diff --git a/xmlStyles.go b/xmlStyles.go index e8aaef6..43bf945 100644 --- a/xmlStyles.go +++ b/xmlStyles.go @@ -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"` }