Bug 44892

Summary: [patch] HSSFWorkbook.getSheet(String name) should be case insensitive
Product: POI Reporter: a.degoy <a.degoy>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: major    
Priority: P1    
Version: 3.0-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: svn diff of 5 changed files

Description a.degoy 2008-04-28 11:02:25 UTC
Version : 3.0.2-20080204

In HSSFWorkbook the getSheet function is case sensitive :
"
  public HSSFSheet getSheet(String name)
    {
        HSSFSheet retval = null;

        for (int k = 0; k < sheets.size(); k++)
        {
            String sheetname = workbook.getSheetName(k);

            if (sheetname.equals(name)) // here is the problem
            {
                retval = (HSSFSheet) sheets.get(k);
            }
        }
        return retval;
    }
"

MS Excel or OpenOffice are non case sensitive for sheetName : equalsignorecase should be used instead of equals.
Comment 1 Josh Micich 2008-04-28 13:36:38 UTC
Created attachment 21875 [details]
svn diff of 5 changed files

Seems like a similar change is required in Workbook.doesContainsSheetName(String, int).  Updated javadocs and added one junit.

Saved patch as an attachment because svn is not taking commits right now.
Comment 2 Josh Micich 2008-04-30 20:24:49 UTC
(In reply to comment #1)
> Created an attachment (id=21875) [details]

Applied in svn r652426