From e8961f0affd1ce9656a57b24cad4cfd080781556 Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 8 May 2018 10:36:13 +0800 Subject: - Bugfix: set font family not works, relate issue #222; - Remove useless function `replaceWorkSheetsRelationshipsNameSpace()`; - Make test cases use strict error checking --- styles.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'styles.go') diff --git a/styles.go b/styles.go index 0a9cbef..daa3447 100644 --- a/styles.go +++ b/styles.go @@ -1938,9 +1938,6 @@ func (f *File) NewConditionalStyle(style string) (int, error) { // setFont provides function to add font style by given cell format settings. func setFont(formatStyle *formatStyle) *font { fontUnderlineType := map[string]string{"single": "single", "double": "double"} - if formatStyle.Font.Family == "" { - formatStyle.Font.Family = "Calibri" - } if formatStyle.Font.Size < 1 { formatStyle.Font.Size = 11 } @@ -1954,7 +1951,10 @@ func setFont(formatStyle *formatStyle) *font { Color: &xlsxColor{RGB: getPaletteColor(formatStyle.Font.Color)}, Name: &attrValString{Val: formatStyle.Font.Family}, Family: &attrValInt{Val: 2}, - Scheme: &attrValString{Val: "minor"}, + } + if f.Name.Val == "" { + f.Name.Val = "Calibri" + f.Scheme = &attrValString{Val: "minor"} } val, ok := fontUnderlineType[formatStyle.Font.Underline] if ok { -- cgit v1.2.1