Bug 47606 - XSSFCell.parseCellNum is not working for more than 702 (ZZ) colums
Summary: XSSFCell.parseCellNum is not working for more than 702 (ZZ) colums
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.5-dev
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-30 01:28 UTC by Rolf Tyzuk
Modified: 2009-08-05 10:02 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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