diff options
author | xuri <xuri.me@gmail.com> | 2022-05-15 15:38:40 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-05-15 15:38:40 +0800 |
commit | 19a0cf3cec71fc49851d29fb420674b027f50d93 (patch) | |
tree | 4603ca353c4fa71be49edc6b4c99ebec4fd8d6eb /cell.go | |
parent | c2311ce87dd2c681406728f885d2228dbefd7a21 (diff) |
This closed #1163, fix set cell value with column and row style inherit issue
Diffstat (limited to 'cell.go')
-rw-r--r-- | cell.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1145,6 +1145,11 @@ func (f *File) prepareCellStyle(ws *xlsxWorksheet, col, row, style int) int { if style != 0 { return style } + if row <= len(ws.SheetData.Row) { + if styleID := ws.SheetData.Row[row-1].S; styleID != 0 { + return styleID + } + } if ws.Cols != nil { for _, c := range ws.Cols.Col { if c.Min <= col && col <= c.Max && c.Style != 0 { @@ -1152,11 +1157,6 @@ func (f *File) prepareCellStyle(ws *xlsxWorksheet, col, row, style int) int { } } } - if row <= len(ws.SheetData.Row) { - if styleID := ws.SheetData.Row[row-1].S; styleID != 0 { - return styleID - } - } return style } |