Bug 35799

Summary: New cell in a column that has specific formatting should retain formatting in the cell
Product: POI Reporter: Amol Deshmukh <amolweb>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.0-dev   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: [PATCH] changes to Sheet, HSSFCell

Description Amol Deshmukh 2005-07-19 22:55:34 UTC
Currently, if an xls file has a column with a non default style applied to it,
then creating a cell in that column causes a cell with default formatting to be
created instead of the cell retaining the formatting of the column.

This is /probably/ because in the HSSFCell contructor we always create a new
cell style. This needs to be changed to first check to see if the corresponding
column has an extended format record associated with it. If an XF record is
present for the column (ie. ColInfoRecord exists spanning the cells column).
Comment 1 Amol Deshmukh 2005-07-20 16:16:34 UTC
Created attachment 15719 [details]
[PATCH] changes to Sheet, HSSFCell

added Sheet.getXFIndexForColAt(short) to enable retrieving the index of
ExtendedFormatRecord for a column. This value is used as the default for the
HSSFCell (instead of the workbook default).
Also added junit test method: TestSheet.testXFIndexForColumn()