Bug 65711

Summary: XSLFSheet.importBlip overrides relation IDs
Product: POI Reporter: Max <0x00ten>
Component: XSLFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: roman.melnik
Priority: P2    
Version: 5.0.x-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Fix overriding relation IDs in the "importBlip" method of the "XSLFSheet" class
Fix overriding relation IDs in the "importBlip" method of the "XSLFSheet" class
Fix overriding relation IDs in the "importBlip" method of the "XSLFSheet" class
Fix overriding relation IDs in the "importBlip" method of the "XSLFSheet" class

Description Max 2021-11-29 11:38:19 UTC
Created attachment 38106 [details]
Fix overriding relation IDs in the "importBlip" method of the "XSLFSheet" class

The "importBlip" method of the "XSLFSheet" class creates relations with the same IDs as the original blips causing possible collisions.
Comment 1 PJ Fanning 2021-11-29 11:40:34 UTC
thanks - but can you provide a unit test?
Comment 2 Max 2021-11-29 13:34:00 UTC
Created attachment 38107 [details]
Fix overriding relation IDs in the "importBlip" method of the "XSLFSheet" class

Hi. Sure, updated the patch.
Comment 3 Max 2021-11-29 13:40:16 UTC
Created attachment 38108 [details]
Fix overriding relation IDs in the "importBlip" method of the "XSLFSheet" class
Comment 4 PJ Fanning 2021-11-29 13:45:01 UTC
Comment on attachment 38107 [details]
Fix overriding relation IDs in the "importBlip" method of the "XSLFSheet" class

importBlip is not a public method? Do you have a test case that reproduces your issue that only uses public methods? It's possible that you are not using the APIs like they were intended to be used.
Comment 5 Max 2021-11-29 14:39:10 UTC
Created attachment 38109 [details]
Fix overriding relation IDs in the "importBlip" method of the "XSLFSheet" class

Updated the patch with a test with a real presentation.
Comment 6 PJ Fanning 2021-11-29 15:18:22 UTC
Comment on attachment 38109 [details]
Fix overriding relation IDs in the "importBlip" method of the "XSLFSheet" class

this change seems to make this test fail -

TestXSLFBugs > bug62587() FAILED
    org.opentest4j.AssertionFailedError at TestXSLFBugs.java:291

there could be more issues
Comment 7 PJ Fanning 2021-11-29 15:36:17 UTC
Comment on attachment 38108 [details]
Fix overriding relation IDs in the "importBlip" method of the "XSLFSheet" class

made a preliminary commit - r1895405 - will follow up and add extra tests if this doesn't cause more problems
Comment 8 PJ Fanning 2021-11-29 16:09:41 UTC
added test using r1895407
Comment 9 PJ Fanning 2021-11-29 16:09:48 UTC
added test using r1895407