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).
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?
Created attachment 25906 [details] Test spreadsheet
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
Applied in r987256, junit added. Thanks, Yegor