diff options
author | xuri <xuri.me@gmail.com> | 2018-05-08 10:36:13 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2018-05-08 10:36:13 +0800 |
commit | e8961f0affd1ce9656a57b24cad4cfd080781556 (patch) | |
tree | efdd978302f8ddb410c5f0e4d9d6e22b39c397a4 /styles.go | |
parent | 038e34250f3ff827d85434b65cbba86a95724318 (diff) |
- Bugfix: set font family not works, relate issue #222;
- Remove useless function `replaceWorkSheetsRelationshipsNameSpace()`;
- Make test cases use strict error checking
Diffstat (limited to 'styles.go')
-rw-r--r-- | styles.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 { |