Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

XSSFFont CloneStyleFrom is linking two fonts instead of creating a copy #317

Closed
igorjrr opened this issue Feb 26, 2020 · 1 comment
Closed

Comments

@igorjrr
Copy link

igorjrr commented Feb 26, 2020

XSSFFont fontToBeApplied = (XSSFFont)Workbook.CreateFont();
fontToBeApplied.CloneStyleFrom(writableColumn.DefaultCellFont);

When doing
fontToBeApplied.IsBold = true;

The writableColumn.DefaultCellFont.IsBold is also set to True.

@igorjrr
Copy link
Author

igorjrr commented Feb 27, 2020

Not only fonts, but XSSFCellStyle as well. Cloning a style, immediately modifying the border in the cloned style (even before applying it to a Cell) is also modifying the border in the original style.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants