Bug 23954 - HSSFRow.getLastCellNum() returns value for current row?
Summary: HSSFRow.getLastCellNum() returns value for current row?
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-pre3
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-20 19:32 UTC by Gary Strackbein
Modified: 2006-09-11 04:33 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Strackbein 2003-10-20 19:32:18 UTC
It seems that HSSFRow.getLastCellNum() returns the number of the last non-empty 
cell in the LONGEST row of the sheet, not in the CURRENT row of the sheet.  Is 
this the intent?  If so, it seems like it should be a method in HSSFSheet.  
Having it in HSSFRow implies (to me) that it is the number of the last non-
empty cell in the current row.
Eg., if the last cell in row 0 containing a value is the fifth cell and the 
last cell in row 1 containing a value is the sixth cell, the following code 
returns a value of 6 for count:

HSSFRow row = sheet.getRow(0);
int count = row.getLastCellNum();

Seems to me it should return 5.  The javadocs for this method say it returns 
the number of the last cell contained in THIS row.
Comment 1 Gary Strackbein 2004-02-02 18:12:39 UTC
Can someone confirm for me whether my interpretation is correct, that 
HSSFRow.getLastCellNum() returns the number of the last non-empty 
cell in the LONGEST row of the sheet, not in the CURRENT row of the sheet?  
And, if so, whether it will stay that way?

Thanks.
Gary
Comment 2 Jason Height 2006-09-11 11:33:15 UTC
Nope, it returns the information for the current row BUT the javadoc has not
been 100% correct for a long time. It returns the last cell numbver + 1.



Jason