From 882abb80988b7c50286dd2e6c6589fab10662db6 Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 10 May 2020 16:56:08 +0800 Subject: - formula engine: reduce cyclomatic complexity - styles: allow empty and default cell formats, #628 --- styles.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'styles.go') diff --git a/styles.go b/styles.go index 61b8e53..72b2071 100644 --- a/styles.go +++ b/styles.go @@ -2299,21 +2299,21 @@ func setBorders(style *Style) *xlsxBorder { // cell. func setCellXfs(style *xlsxStyleSheet, fontID, numFmtID, fillID, borderID int, applyAlignment, applyProtection bool, alignment *xlsxAlignment, protection *xlsxProtection) int { var xf xlsxXf - xf.FontID = fontID + xf.FontID = intPtr(fontID) if fontID != 0 { - xf.ApplyFont = true + xf.ApplyFont = boolPtr(true) } - xf.NumFmtID = numFmtID + xf.NumFmtID = intPtr(numFmtID) if numFmtID != 0 { - xf.ApplyNumberFormat = true + xf.ApplyNumberFormat = boolPtr(true) } - xf.FillID = fillID - xf.BorderID = borderID + xf.FillID = intPtr(fillID) + xf.BorderID = intPtr(borderID) style.CellXfs.Count++ xf.Alignment = alignment - xf.ApplyAlignment = applyAlignment + xf.ApplyAlignment = boolPtr(applyAlignment) if applyProtection { - xf.ApplyProtection = applyProtection + xf.ApplyProtection = boolPtr(applyProtection) xf.Protection = protection } xfID := 0 -- cgit v1.2.1