Summary: | Add support for named ranges in formulas | ||
---|---|---|---|
Product: | POI | Reporter: | Orr Bernstein <orr> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 3.0-dev | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other | ||
Attachments: | Replaced the comment in FormulaParser:Ident identifying the need to support named ranges |
Description
Orr Bernstein
2007-09-28 13:38:21 UTC
Created attachment 20895 [details]
Replaced the comment in FormulaParser:Ident identifying the need to support named ranges
This patch implements formula support for named ranges by first identifying
cell references using a regex. Anything that isn't a cell reference or boolean
literal is then checked against the workbook's set of NameRecords. If no
NameRecord is found, Abort is called with an error message to that effect.
Otherwise, a "NamePtg" is added to the tokens list.
The cell reference regex is very liberal in order to support future versions of
Excel. For example, it allows any length sheet name (though Excel 2003 only
supports 31-character sheet names); it allows any number of alphabetical
characters as the column reference (Excel 2007 supports 2^14 columns - three
characters); and it allows any number of digits as the row reference (again,
Excel 2007 supports 2^20 rows - 7 digits).
Thanks for this, committed (had to make a few small tweaks), along with a unit test for it |