Bug 58785 - XSLFSlide.importContent does not keep names of shapes inside an XSLFGroupShape
Summary: XSLFSlide.importContent does not keep names of shapes inside an XSLFGroupShape
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 3.13-FINAL
Hardware: PC Linux
: P2 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-30 16:43 UTC by Nicolas Cailloux
Modified: 2017-11-06 20:27 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Cailloux 2015-12-30 16:43:54 UTC
XSLFSlide originalSlide = presentation.getSlides.get(0)
XSLFSlide newSlide = presentation.createSlide(originalSlide.getSlideLayout)
newSlide.importContent(originalSlide)
System.out.println(originalSlide.getXmlObject)
System.out.println(newSlide.getXmlObject)

If the slide contains an XSLFGroupShape, this shape is copied with its name. But all shapes contained in the group will miss their name. 

After following importContent workflow, copy code is here: 
https://svn.apache.org/repos/asf/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java

When checking "copy" function, it creates new shapes, but they get a default name such as "TextBox 83"!
Comment 1 Dominik Stadler 2017-11-06 20:27:36 UTC
I tried to reproduce this with the current version of Apache POI, but could not. It seems this is already fixed since some time via other changes.

I have added a corresponding unit-test in r1814440 to verify that it works as far as I see. 

If you still see a problem with this, please report a new issue together with a unit-test which allows to reproduce the problem.