https://bz.apache.org/bugzilla/show_bug.cgi?id=60866
Bug ID: 60866
Summary: Support for named cell styles in SS Common
Product: POI
Version: 3.16-dev
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: SS Common
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 34826
--> https://bz.apache.org/bugzilla/attachment.cgi?id=34826&action=edit
Patch adding support for named cell styles
Dear all,
I was working on support for named cell styles in SS Common. Please find
attached a patch with the proposed changes. Would be great if someone could
review that.
While HSSFCellStyle allowed setting a user style name for a while, this was not
possible with XSSFCellStyle. Generally, the model in XSSF is a bit more
complicated due to the separation of cell and cell style formatting records
(cell xfs vs cell style xfs). An XSSFCellStyle in POI is generally a
combination of both a cell xf and a cell style xf. Only the latter (actually
only cell styles (CTCellStyle) which reference a cell style xf) can have a
name. The idea of supporting named cell styles in XSSFCellStyle is therefore
the following:
- an XSSFCellStyle which references an "empty" cell xf (i.e. no cell-specific
formatting) which in turn references a cell style xf which has a name through a
cell style record (CTCellStyle) is considered a named XSSFCellStyle
- a named XSSFCellStyle can be created at any time from a (non-named)
XSSFCellStyle by merging the cell xf and cell style xf information and creating
a new cell style xf record and an appropriate CTCellStyle entry; the
XSSFCellStyle can be updated by using the newly created cell style xf and an
empty cell xf
A test case which illustrates the use is included in the attached patch.
Best regards,
Martin
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]