poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 57307] New: removeMergedRegion() throws IndexOutOfBoundsException on .xlsx MS-Excel file
Date Thu, 04 Dec 2014 12:22:08 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=57307

            Bug ID: 57307
           Summary: removeMergedRegion() throws IndexOutOfBoundsException
                    on .xlsx MS-Excel file
           Product: POI
           Version: 3.10-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: pulikkot@aol.com

Created attachment 32259
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=32259&action=edit
removeMergedRegion tested excel

removeMergedRegion() throws an IndexOutOfBoundsException on .xlsx file. But is
working on .xls file

Here I have pasted the tested the code 

void removeRow(Sheet sheet){
    if(sheet){
        for(i in sheet.getFirstRowNum()..sheet.getLastRowNum()){
            Row row = sheet.getRow(i)
            if(!row){
                continue
            }
            for(j in row.getFirstCellNum()..row.getLastCellNum()){
                if(j<0){
                    continue
                }
                sheet.removeMergedRegion(j)
            }
            sheet.removeMergedRegion(i)
            sheet.removeRow(row)
        }
    }
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message