Bug 49751 - Cannot get named style name
Summary: Cannot get named style name
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.7-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-15 12:49 UTC by Vladimir Korenev
Modified: 2010-08-19 14:10 UTC (History)
0 users



Attachments
A patch fixing this bug. (560 bytes, patch)
2010-08-15 12:49 UTC, Vladimir Korenev
Details | Diff
Test spreadsheet (19.00 KB, application/vnd.ms-excel)
2010-08-18 11:43 UTC, Vladimir Korenev
Details
Test program (876 bytes, text/x-java)
2010-08-18 11:45 UTC, Vladimir Korenev
Details

Note You need to log in before you can comment on or make changes to this bug.
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