Bug 49689

Summary: Can't set the user style name on custom cell styles
Product: POI Reporter: Nick Burch <apache>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.7-dev   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Nick Burch 2010-08-02 12:49:08 UTC
As reported on the mailing list at: http://mail-archives.apache.org/mod_mbox/poi-user/201007.mbox/%3C000901cb2fd1$7eb48060$7c1d8120$@studer@mirai-solutions.com%3E

HSSFWorkbook wb = ...
HSSFCellStyle cs = wb.createCellStyle();
cs.setUserStyleName(name);

However, when I try to do that I get an "Unable to set user specified style
names for built in styles!" exception. When I'm creating a new cell style, I
shouldn't be getting a built-in style, should I?
Comment 1 Nick Burch 2010-08-03 11:36:35 UTC
Should be fixed in r981930 - because all StyleRecords have the builtin flag set when created, we now also check the index to decide if they need to remain that way