Bug 43401

Summary: Unable to outline and collapse rows >= 32767
Product: POI Reporter: Ross Mills <rmills>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: major    
Priority: P1    
Version: unspecified   
Target Milestone: ---   
Hardware: Sun   
OS: Solaris   

Description Ross Mills 2007-09-14 15:07:02 UTC
Attempts to outline and collapse rows that include or come after 32767 results 
in a NullPointerException.
Comment 1 Ross Mills 2007-09-14 16:17:09 UTC
org.apache.poi.hssf.record.aggregates.RowRecordsAggregate was casting the row 
number to a short when calling RowRecord.setRowNumber.  This method takes an 
int - not a short.  I removed the cast and the problem was resolved.  Can 
someone please add this fix (or something like it) to the codebase.

My change is below...

    public RowRecord getRow(int rownum)
    {

        // Integer integer = new Integer(rownum);
        RowRecord row = new RowRecord();

        //row.setRowNumber(( short ) rownum);  -- I commented this line out
        row.setRowNumber(rownum);
        return ( RowRecord ) records.get(row);
    }
Comment 2 Nick Burch 2007-09-17 09:56:06 UTC
Thanks, patch applied (with a few tweaks)