Bug 62587

Summary: repeated call to XSLFSheet.removeShape leads to java.lang.IllegalArgumentException: partName
Product: POI Reporter: florian.sc.schneider
Component: XSLFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: major    
Priority: P2    
Version: 3.17-FINAL   
Target Milestone: ---   
Hardware: Macintosh   
OS: All   
Attachments: Stacktrace of reported error
JUnit causing the problem / workaround

Description florian.sc.schneider 2018-07-31 12:11:30 UTC
Created attachment 36060 [details]
Stacktrace of reported error

I am having a Slide Show with 1 Slides, containing exactly one picture shape pointing to one EMF embedded into the slide.

In code, I duplicate the slide n times, and then try to "replace" that picture shape by creating a new picture shape with the same dimensions and removing the old picture shape.

POI then crashes on the second call to 
org.apache.poi.xslf.usermodel.XSLFSheet.removePictureRelation(XSLFSheet.java:649)

See full stack trace attached.
Comment 1 Andreas Beeker 2018-08-10 22:55:02 UTC
Created attachment 36087 [details]
JUnit causing the problem / workaround

Find attached a short test case and a workaround

The error is based on missing relationships across slides
Comment 2 Andreas Beeker 2018-08-11 01:56:17 UTC
Fix via r1837839