From 219add2f0e4ae591141330648d410b60f5c0dbcf Mon Sep 17 00:00:00 2001 From: Eagle Xiang Date: Thu, 28 Jan 2021 21:13:23 +0800 Subject: =?UTF-8?q?value=20fields=20xlsxPatternFill.FgColor=20&=20xlsxPatt?= =?UTF-8?q?ernFill.BgColor=20cause=20=E2=80=A6=20(#770)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * value fields xlsxPatternFill.FgColor & xlsxPatternFill.BgColor cause ineffective omitempty tags * remove useless omitempty tag on xlsxPatternFill.FgColor and xlsxPatternFill.BgColor --- styles.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'styles.go') diff --git a/styles.go b/styles.go index c2dc7fa..9fd0f18 100644 --- a/styles.go +++ b/styles.go @@ -2432,8 +2432,14 @@ func newFills(style *Style, fg bool) *xlsxFill { var pattern xlsxPatternFill pattern.PatternType = patterns[style.Fill.Pattern] if fg { + if pattern.FgColor == nil { + pattern.FgColor = new(xlsxColor) + } pattern.FgColor.RGB = getPaletteColor(style.Fill.Color[0]) } else { + if pattern.BgColor == nil { + pattern.BgColor = new(xlsxColor) + } pattern.BgColor.RGB = getPaletteColor(style.Fill.Color[0]) } fill.PatternFill = &pattern -- cgit v1.2.1