Bug 47606

Summary: XSSFCell.parseCellNum is not working for more than 702 (ZZ) colums
Product: POI Reporter: Rolf Tyzuk <tyzuk>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.5-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Rolf Tyzuk 2009-07-30 01:28:52 UTC
When reading an Excel 2007 sheet with rows with more than 702 columns the method XSSFRow.getLastCellNum() reports 702 instead of the correct number.

The problem seems to be in the class XSSFCell. The method parseCellNum(String) does not work for more then two characters:

    protected static short parseCellNum(String r)
    {
        r = r.split("\\d+")[0];
        if(r.length() == 1)
            return (short)(r.charAt(0) - 65);
        else
            return (short)((r.charAt(1) - 65) + 26 * (r.charAt(0) - 64));
    }

Regards
Rolf
Comment 1 Yegor Kozlov 2009-08-05 10:02:29 UTC
Fixed in r801305

Regards,
Yegor