Bug 14910 - HSSFRow.getLastCellNum() method returning incorrect value
Summary: HSSFRow.getLastCellNum() method returning incorrect value
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 1.5.1
Hardware: PC All
: P3 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
: 15184 (view as bug list)
Depends on:
Reported: 2002-11-27 19:52 UTC by Nishant
Modified: 2005-03-20 17:06 UTC (History)
1 user (show)

simple java file to reproduce problem (1.36 KB, text/plain)
2002-11-27 19:53 UTC, Nishant
test excel file (13.50 KB, application/octet-stream)
2002-11-27 19:53 UTC, Nishant

Note You need to log in before you can comment on or make changes to this bug.
Description Nishant 2002-11-27 19:52:17 UTC
There are two similar methods HSSFSheet.getLastRowNum() and 
HSSFRow.getLastCellNum() -- they should return the actual location of the last 
row or cell for the spreadsheet. So for a sheet with 10 rows and 12 columns, 
the values returned should be 9 (rows) and 11 (columns) as numbering is 0-based.

However getLastCellNum() returns the count (ie. 12) instead of the actual 
location. I had sent out email to the mailing list with a simple program to 
test this functionality along with a test excel file. Please use those (since 
it doesnt seem like I can attach files to this bug report). Also note that I 
tried this only on WinNT but it might be a problem on other platforms as well ??
Comment 1 Nishant 2002-11-27 19:53:27 UTC
Created attachment 3971 [details]
simple java file to reproduce problem
Comment 2 Nishant 2002-11-27 19:53:58 UTC
Created attachment 3972 [details]
test excel file
Comment 3 Nishant 2002-11-27 19:54:29 UTC
managed to attach the files here. check them out !
Comment 4 Avik Sengupta 2002-12-12 12:58:13 UTC
*** Bug 15184 has been marked as a duplicate of this bug. ***
Comment 5 Avik Sengupta 2002-12-12 13:06:38 UTC
This should NOT be changed in a hurry without understanding the implications,
since the method is called internally many times. Further, this will be a
backward-incompatible change. So, further thougth needed. 
Comment 6 Andy Oliver 2003-07-24 13:55:31 UTC
I don't think htis is a bug.