You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2003/05/13 15:13:11 UTC
DO NOT REPLY [Bug 19888] New: -
[PATCH] Make CellReference and AreaReference sheetName aware
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19888>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19888
[PATCH] Make CellReference and AreaReference sheetName aware
Summary: [PATCH] Make CellReference and AreaReference sheetName
aware
Product: POI
Version: unspecified
Platform: All
OS/Version: Other
Status: NEW
Severity: Enhancement
Priority: Other
Component: HSSF
AssignedTo: poi-dev@jakarta.apache.org
ReportedBy: brett.knights@tanner.com
for v 1.11 HEAD
This patch contains two related fixes.
The first is to allow CellReference and AreaReference constructors to recognize
a reference containing a sheet name.
This allows CellReference to be used with the reference returned by
e.g.
HSSFName orderRefName = wb.getNameAt(wb.getNameIndex("OrderReference"));
CellReference cellRef = new CellReference(orderRefName.getReference());
HSSFCell orderNameCell = wb.getSheet(cellRef.getSheetName()).getRow
((short)cellRef.getRow()).getCell((short)cellRef.getCol());
This wasn't absolutely necessary since HSSFName has a getSheetName method but
it makes cell reference more useful in the general case. (though CellReference
will probably need a workbook reference as well for properly modeling formulae)
The second makes AreaReference return an array[1] if it was passed a simple
cell reference. This fixes a bug reported on the mailing list in April.