Skip to content

Commit 75d66a0

Browse files
committed
Fix qax-os#482, font strike style support
1 parent 3280e1b commit 75d66a0

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

excelize_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ func TestSetCellStyleFont(t *testing.T) {
775775

776776
assert.NoError(t, f.SetCellStyle("Sheet2", "A4", "A4", style))
777777

778-
style, err = f.NewStyle(`{"font":{"color":"#777777"}}`)
778+
style, err = f.NewStyle(`{"font":{"color":"#777777","strike":true}}`)
779779
if !assert.NoError(t, err) {
780780
t.FailNow()
781781
}

styles.go

+4
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,10 @@ func (f *File) setFont(formatStyle *formatStyle) *xlsxFont {
19931993
if fnt.Name.Val == "" {
19941994
fnt.Name.Val = f.GetDefaultFont()
19951995
}
1996+
if formatStyle.Font.Strike {
1997+
strike := true
1998+
fnt.Strike = &strike
1999+
}
19962000
val, ok := fontUnderlineType[formatStyle.Font.Underline]
19972001
if ok {
19982002
fnt.U = &attrValString{Val: val}

xmlStyles.go

+1
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ type formatFont struct {
320320
Underline string `json:"underline"`
321321
Family string `json:"family"`
322322
Size float64 `json:"size"`
323+
Strike bool `json:"strike"`
323324
Color string `json:"color"`
324325
}
325326

0 commit comments

Comments
 (0)