diff options
author | xuri <xuri.me@gmail.com> | 2020-04-24 08:26:16 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2020-04-24 08:26:16 +0800 |
commit | 2285d4dc718fb8b96c3b2291c63b39c57468b0b9 (patch) | |
tree | 0690e862e54512d5ba676f8e2555954a112e5bf6 /rows.go | |
parent | 1fe660df648422a53eef0c735657cb2f5237ef7b (diff) |
handle the cell without r attribute in a row element
Diffstat (limited to 'rows.go')
-rw-r--r-- | rows.go | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -593,6 +593,22 @@ func checkRow(xlsx *xlsxWorksheet) error { if colCount == 0 { continue } + // check and fill the cell without r attribute in a row element + rCount := 0 + for idx, cell := range rowData.C { + rCount++ + if cell.R != "" { + lastR, _, err := CellNameToCoordinates(cell.R) + if err != nil { + return err + } + if lastR > rCount { + rCount = lastR + } + continue + } + rowData.C[idx].R, _ = CoordinatesToCellName(rCount, rowIdx+1) + } lastCol, _, err := CellNameToCoordinates(rowData.C[colCount-1].R) if err != nil { return err |