Bug 51470

Summary: java.lang.IndexOutOfBoundsException during XSSF Workbook.cloneSheet()
Product: POI Reporter: kiruba3441 <kirubakaran.d>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: abang878
Priority: P2    
Version: 3.7-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: xlsx File containing a background Image

Description kiruba3441 2011-07-04 12:47:07 UTC
Created attachment 27250 [details]
xlsx File containing a background Image

The XSSF workbook clonesheet throws a Indexoutofbounds exception error, i see that it has been fixed for the HSSFWorkbook, but XSSFWorkbook throws an error.

The error occurs only when the xlsx file has a background image. 

code
/***********************************************************/
XSSFWorkbook workbook = new XSSFWorkbook();
template = "C:/work/Book1.xlsx";
if (template != null) {
 InputStream in = new FileInputStream(template);
 workbook = new XSSFWorkbook(in);
}
workbook.cloneSheet(0);
/***********************************************************/

Exception in thread "main" java.lang.IndexOutOfBoundsException
	at org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTWorksheetImpl.getColsArray(Unknown Source)
Comment 1 Nick Burch 2011-07-04 12:58:47 UTC
Could you try with 3.8 beta 3 and see if that helps?
Comment 2 kiruba3441 2011-07-04 13:06:51 UTC
I tried it and it doesn't seem to help.
Comment 3 Yegor Kozlov 2011-07-20 12:34:57 UTC
Fixed in r1148724, junit added

Yegor