Bug 35799 - New cell in a column that has specific formatting should retain formatting in the cell
Summary: New cell in a column that has specific formatting should retain formatting in...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-dev
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-19 22:55 UTC by Amol Deshmukh
Modified: 2005-07-20 08:16 UTC (History)
0 users



Attachments
[PATCH] changes to Sheet, HSSFCell (7.60 KB, patch)
2005-07-20 16:16 UTC, Amol Deshmukh
Details | Diff

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