Skip to content

Commit

Permalink
This closes qax-os#1264, fix can't modify cell content issue in some …
Browse files Browse the repository at this point in the history
…cases

Remove inline rich text when setting cell value and cell formulas
  • Loading branch information
xdlrt authored and xuri committed Oct 9, 2022
1 parent 4557ad5 commit 51064fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cell.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ func (f *File) SetCellInt(sheet, axis string, value int) error {
defer ws.Unlock()
cellData.S = f.prepareCellStyle(ws, col, row, cellData.S)
cellData.T, cellData.V = setCellInt(value)
cellData.F, cellData.IS = nil, nil
return err
}

Expand All @@ -291,6 +292,7 @@ func (f *File) SetCellBool(sheet, axis string, value bool) error {
defer ws.Unlock()
cellData.S = f.prepareCellStyle(ws, col, row, cellData.S)
cellData.T, cellData.V = setCellBool(value)
cellData.F, cellData.IS = nil, nil
return err
}

Expand Down Expand Up @@ -328,6 +330,7 @@ func (f *File) SetCellFloat(sheet, axis string, value float64, precision, bitSiz
defer ws.Unlock()
cellData.S = f.prepareCellStyle(ws, col, row, cellData.S)
cellData.T, cellData.V = setCellFloat(value, precision, bitSize)
cellData.F, cellData.IS = nil, nil
return err
}

Expand All @@ -353,6 +356,7 @@ func (f *File) SetCellStr(sheet, axis, value string) error {
defer ws.Unlock()
cellData.S = f.prepareCellStyle(ws, col, row, cellData.S)
cellData.T, cellData.V, err = f.setCellString(value)
cellData.F, cellData.IS = nil, nil
return err
}

Expand Down Expand Up @@ -451,6 +455,7 @@ func (f *File) SetCellDefault(sheet, axis, value string) error {
defer ws.Unlock()
cellData.S = f.prepareCellStyle(ws, col, row, cellData.S)
cellData.T, cellData.V = setCellDefault(value)
cellData.F, cellData.IS = nil, nil
return err
}

Expand Down Expand Up @@ -599,7 +604,7 @@ func (f *File) SetCellFormula(sheet, axis, formula string, opts ...FormulaOpts)
cellData.F.Ref = *o.Ref
}
}

cellData.IS = nil
return err
}

Expand Down

0 comments on commit 51064fe

Please sign in to comment.