Bug 47028

Summary: Inconsistent behavior between HSSF, XSSF: Cell.setCellStyle(...)
Product: POI Reporter: Matthew <matthew.knl>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.5-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: test.xlsm
test.xls

Description Matthew 2009-04-14 03:11:09 UTC
Created attachment 23490 [details]
test.xlsm

I have two workbooks "test.xlsm" and "test.xls". I write following codes to set the cell "B2" to blank. The result behavior are different, XSSFWorkbook will clear the CellStyle of the blank cell but HSSFWorkbook won't.

--
Workbook source = (read "test.xlsm" or "test.xls")
Sheet sheet = source.getSheetAt(0);
Row row = sheet.getRow(1);
Cell cell = row.getCell(0);		
cell.setCellType(Cell.CELL_TYPE_BLANK);
source.write(...);
--

The expected behavior should follow HSSFWorkbook, i.e. CellStyle won't be clear since only cell value is set to blank.
Comment 1 Matthew 2009-04-14 03:11:25 UTC
Created attachment 23491 [details]
test.xls
Comment 2 Yegor Kozlov 2009-04-17 11:09:14 UTC
Fixed in r766103

Yegor