Bug 47028 - Inconsistent behavior between HSSF, XSSF: Cell.setCellStyle(...)
Summary: Inconsistent behavior between HSSF, XSSF: Cell.setCellStyle(...)
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.5-dev
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-14 03:11 UTC by Matthew
Modified: 2009-04-17 11:09 UTC (History)
0 users



Attachments
test.xlsm (8.13 KB, application/vnd.ms-excel.sheet.macroenabled.12)
2009-04-14 03:11 UTC, Matthew
Details
test.xls (16.50 KB, application/vnd.ms-excel)
2009-04-14 03:11 UTC, Matthew
Details

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