Bug 49751

Summary: Cannot get named style name
Product: POI Reporter: Vladimir Korenev <vkorenev>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.7-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: A patch fixing this bug.
Test spreadsheet
Test program

Description Vladimir Korenev 2010-08-15 12:49:28 UTC
Created attachment 25889 [details]
A patch fixing this bug.

For some sheets HSSFCellStyle.getUserStyleName() returns nothing for a named style because of a bug in InternalWorkbook.getStyleRecord(int).
Comment 1 Nick Burch 2010-08-15 17:44:39 UTC
Any chance you could upload a file that exhibits this problem, so we can write a unit test to go with applying the patch to ensure we don't break it again later?
Comment 2 Vladimir Korenev 2010-08-18 11:43:54 UTC
Created attachment 25906 [details]
Test spreadsheet
Comment 3 Vladimir Korenev 2010-08-18 11:45:42 UTC
Created attachment 25907 [details]
Test program

The output should be:

20% - Accent1
20% - Accent2
20% - Accent3
20% - Accent4
20% - Accent5
20% - Accent6
40% - Accent1
40% - Accent2
40% - Accent3
40% - Accent4
40% - Accent5
40% - Accent6
60% - Accent1
60% - Accent2
60% - Accent3
60% - Accent4
60% - Accent5
60% - Accent6
Accent1
Accent2
Accent3
Accent4
Accent5
Accent6
Bad
Calculation
Check Cell
Explanatory Text
Good
Heading 1
Heading 2
Heading 3
Heading 4
Input
Linked Cell
Neutral
Note
Output
Title
Total
Warning Text
Comment 4 Yegor Kozlov 2010-08-19 14:10:32 UTC
Applied in r987256, junit added.

Thanks,
Yegor