Bug 48718

Summary: XSSFWorkbook.createFont fails to add font to styletable if un-modified Font was created
Product: POI Reporter: Payam Hekmat <payam.hekmat>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: kiwiwings
Priority: P2    
Version: 3.6-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

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