Bug 60662

Summary: Slide import delete unrecognized elements in group shape
Product: POI Reporter: Aurélien <amanteaux+bzapache>
Component: XSLFAssignee: POI Developers List <dev>
Severity: normal CC: dpelevin
Priority: P2    
Version: 3.16-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Minimal project to reproduce the bug.

Description Aurélien 2017-01-30 10:39:57 UTC
If I try to import a slide that contains a group of shapes, these contained shapes will lost all the properties that are not handled by POI: shadow (and everything in a:effectLst) etc.

However, if contained shapes are ungrouped, then these non-handled properties are kept and all is working fine.

The issue comes from XSLFGroupShape.copy(source): it removes all its shapes and reconstruct it all. Whereas in XSLFSheet.importContent(), all the shapes are kept but just "updated", not removed and recreated.

Is there a reason why the implementation of XSLFGroupShape.copy(source) is not the same as XSLFSheet.importContent():
XSLFGroupShape gr = (XSLFGroupShape)src;

List<XSLFShape> tgtShapes = getShapes();
List<XSLFShape> srcShapes = gr.getShapes();
for(int i = 0; i < tgtShapes.size(); i++){
    XSLFShape s1 = srcShapes.get(i);
    XSLFShape s2 = tgtShapes.get(i);


If I try to use this implementation all is working as expected. However I wonder, did I miss something?
Comment 1 Dmitry Pelevin 2017-02-14 16:35:47 UTC
Created attachment 34756 [details]
Minimal project to reproduce the bug.

Please check this maven project to reproduce the bug.

You can run it with "mvn clean package && mvn exec:java".

It will insert slide from "src\main\resources\source.pptx" to "src\main\resources\template.pptx" and output will be generated as "merged.pptx" in the current directory.
Comment 2 Andreas Beeker 2017-02-18 01:09:17 UTC
Patched via r1783486

Thanks for the example files.