https://bz.apache.org/bugzilla/show_bug.cgi?id=62736
Mate Borcsok <bmate...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- OS| |All --- Comment #4 from Mate Borcsok <bmate...@gmail.com> --- (In reply to PJ Fanning from comment #3) > Comment on attachment 36155 [details] > change in removePictureRelation function and testcase > > Would it be better if the new code threw an exception if it isn't safe to > remove the picture relation? > > + if (numberOfRelations <= 1) { > + removeRelation(pictureShape.getBlipId()); > + } else { > + throw new IllegalStateException("Cannot remove picture relation > because there are other references to the picture"); > + } As far as I understood, it wouldn't. It is a valid case to remove just one PictureShape, but leave the relation between the Slide and the media. The new testcase would also fail at TestXSLFBugs.bug62736(TestXSLFBugs.java:124) The reason why I used <= 1 that in POIXMLDocumentPart.java we just return false if there are no relations, and I wanted to keep the existing functionality in that case. RelationPart rp = relations.get(partId); if (rp == null) { // part is not related with this POIXMLDocumentPart return false; } -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org