Bug 48718 - XSSFWorkbook.createFont fails to add font to styletable if un-modified Font was created
Summary: XSSFWorkbook.createFont fails to add font to styletable if un-modified Font w...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.6-FINAL
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-09 19:42 UTC by Payam Hekmat
Modified: 2017-07-23 22:33 UTC (History)
1 user (show)



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