Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 9f8dba7

Browse files
committed
Fixes issue when newly added rows are missing from file
If a sheet were renamed and then new rows were added, the new rows would not be saved in the .xlsx-file. To fix that, makeCellKeyRowPrefix() and makeCellKey() were updated to use cellStoreName, so they use the same key-prefix as makeRowKey does.
1 parent df122de commit 9f8dba7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

row.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ func (r *Row) PushCell(c *Cell) {
8484
}
8585

8686
func (r *Row) makeCellKey(colIdx int) string {
87-
return fmt.Sprintf("%s:%06d:%06d", r.Sheet.Name, r.num, colIdx)
87+
return fmt.Sprintf("%s:%06d:%06d", r.Sheet.cellStoreName, r.num, colIdx)
8888
}
8989

9090
func (r *Row) key() string {
9191
return r.makeCellKeyRowPrefix()
9292
}
9393

9494
func (r *Row) makeCellKeyRowPrefix() string {
95-
return fmt.Sprintf("%s:%06d", r.Sheet.Name, r.num)
95+
return fmt.Sprintf("%s:%06d", r.Sheet.cellStoreName, r.num)
9696
}
9797

9898
// GetCell returns the Cell at a given column index, creating it if it doesn't exist.

0 commit comments

Comments
 (0)