Bug 48718 - XSSFWorkbook.createFont fails to add font to styletable if un-modified Font was created
XSSFWorkbook.createFont fails to add font to styletable if un-modified Font w...
Status: RESOLVED FIXED
Product: POI
Classification: Unclassified
Component: XSSF
3.6-FINAL
PC Windows XP
: P2 normal (vote)
: ---
Assigned To: POI Developers List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-02-09 19:42 UTC by Payam Hekmat
Modified: 2010-05-28 09:45 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Payam Hekmat 2010-02-09 19:42:55 UTC
How to reproduce:
XSSFWorkbook wb = new XSSFWorkbook();
wb.createFont(); 
//this next font gets ignored because the font above was never modified
XSSFFont f = wb.createFont(); 
f.setBold(true);


StylesTable.putFont(font) checks to see if the font is already there as part of createFont(), before any modifications on the font can occur. 

A workaround is to simply not call wb.createFont() if you don't modify the Font afterward, but this may not be viable in all cases.
Comment 1 Nick Burch 2010-05-28 09:45:10 UTC
Fixed in r949177 - XSSF now behaves as HSSF did on creating multiple un-changed fonts