Bug 56467 - [PATCH] cloneSheet() does not properly copy pictures
Summary: [PATCH] cloneSheet() does not properly copy pictures
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.10-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2014-04-28 14:15 UTC by Alessandro Guarascio
Modified: 2019-02-15 07:05 UTC (History)
0 users



Attachments
Here is a proposed patch for XSSFWorkbook.java (323 bytes, patch)
2014-04-29 12:04 UTC, Alessandro Guarascio
Details | Diff
Patch for XSSFWorkbook.java (1.22 KB, patch)
2014-04-29 15:34 UTC, Alessandro Guarascio
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Guarascio 2014-04-28 14:15:52 UTC
After cloning an XSSFSheet with XSSFWorkbook.cloneSheet() method, pictures are not properly copied in the cloned sheet.

e.g. the following 

Drawing drawing = sheet.createDrawingPatriarch();
for (XSSFShape shape : ((XSSFDrawing) drawing).getShapes()) {
    if (shape instanceof XSSFPicture) {
        XSSFPictureData pictureData = ((XSSFPicture) shape).getPictureData();
        // ...
    }
}    

pictureData is null after assignment.
Comment 1 Alessandro Guarascio 2014-04-29 12:04:48 UTC
Created attachment 31570 [details]
Here is a proposed patch for XSSFWorkbook.java
Comment 2 Alessandro Guarascio 2014-04-29 15:34:01 UTC
Created attachment 31574 [details]
Patch for XSSFWorkbook.java

Sorry, ignore the previous attachment which did not create a consistent XSLX file once saved.
Comment 3 Dominik Stadler 2015-03-11 18:25:48 UTC
Applied with r1665959 for inclusion in release 3.12, thanks for providing the patch!
Comment 4 Carol Loomis 2019-02-15 07:05:03 UTC
Is it possible to read the XLS file with Apache POI? XSSFWorkbook may be the reason my code is not working. I'm looking for the options to get the XSSF library at https://www.writemyessayfast.org/write-my-essay-in-6-hours.php projects.