https://issues.apache.org/bugzilla/show_bug.cgi?id=43901
Richard Evans <[EMAIL PROTECTED]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|WORKSFORME |
--- Comment #7 from Richard Evans <[EMAIL PROTECTED]> 2008-03-06 08:46:35 PST
---
I agree with the functionality of getLastCellNum(). The specification is fine
for me.
However the original report was that XLS files _written_ by POI have the wrong
value for getLastCellNum(). If you write an XLS with three columns, then read
it back, getLastCellNum() returns 2 not 3.
If you read a XLS file with three columns generated by Excel, getLastCellNum()
returns 3 as expected.
See the original attachment with this issue.
Our temporary workround was to modify HSSFRow.addCell to read:
/**
* used internally to add a cell.
*/
private void addCell(HSSFCell cell)
{
short column=cell.getCellNum();
if (row.getFirstCol() == -1)
{
row.setFirstCol(column);
}
if (row.getLastCol() == -1)
{
row.setLastCol((short) (column + 1));
}
if(column>=cells.length)
{
HSSFCell[] oldCells=cells;
int newSize=oldCells.length*2;
if(newSize<column+1) newSize=column+1;
cells=new HSSFCell[newSize];
System.arraycopy(oldCells,0,cells,0,oldCells.length);
}
cells[column]=cell;
if (column < row.getFirstCol())
{
row.setFirstCol(column);
}
if (column >= row.getLastCol())
{
row.setLastCol((short) (column + 1));
}
}
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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]