exceljs icon indicating copy to clipboard operation
exceljs copied to clipboard

fix: setting cell style attribute clones style object

Open gmahomarf opened this issue 1 year ago • 0 comments

Summary

Fixes #2055.

When setting a style attribute using the setters defined in Cell (e.g., cell.fill = {...}), the style property is edited in place. This creates issues in cells which share the same style as other cells, because each of those cell's style properties are the same style object. This fix works around that by cloning a cell's style property any time one of the attributes is changed using its setter. This affects the following setters in Cell:

  • numFmt
  • alignment
  • border
  • fill
  • font
  • protection

Test plan

See integration and unit tests in this PR

Related to source code (for typings update)

N/A

gmahomarf avatar Jun 24 '24 11:06 gmahomarf