Bug 51470 - java.lang.IndexOutOfBoundsException during XSSF Workbook.cloneSheet()
Summary: java.lang.IndexOutOfBoundsException during XSSF Workbook.cloneSheet()
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.7-dev
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-04 12:47 UTC by kiruba3441
Modified: 2015-04-08 07:04 UTC (History)
1 user (show)



Attachments
xlsx File containing a background Image (63.94 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2011-07-04 12:47 UTC, kiruba3441
Details

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