summaryrefslogtreecommitdiff
path: root/cell.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-05-15 15:38:40 +0800
committerxuri <xuri.me@gmail.com>2022-05-15 15:38:40 +0800
commit19a0cf3cec71fc49851d29fb420674b027f50d93 (patch)
tree4603ca353c4fa71be49edc6b4c99ebec4fd8d6eb /cell.go
parentc2311ce87dd2c681406728f885d2228dbefd7a21 (diff)
This closed #1163, fix set cell value with column and row style inherit issue
Diffstat (limited to 'cell.go')
-rw-r--r--cell.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/cell.go b/cell.go
index 80c03ef..1e130dc 100644
--- a/cell.go
+++ b/cell.go
@@ -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
}