]> source.dussan.org Git - poi.git/commitdiff
[bug-65711] Fix overriding relation IDs in importBlip
authorPJ Fanning <fanningpj@apache.org>
Mon, 29 Nov 2021 15:35:13 +0000 (15:35 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 29 Nov 2021 15:35:13 +0000 (15:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895405 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFSheet.java
poi-ooxml/src/test/java/org/apache/poi/xslf/TestXSLFBugs.java

index c34d8f3800cbada427d24d2a513b09ba61c203bf..d9879e3637406e621ecba5edc2c791edf106cc9c 100644 (file)
@@ -664,7 +664,7 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> {
             pictureData = ppt.addPicture(parData.getData(), parData.getType());
         }
 
-        RelationPart rp = addRelation(blipId, XSLFRelation.IMAGES, pictureData);
+        RelationPart rp = addRelation(null, XSLFRelation.IMAGES, pictureData);
         return rp.getRelationship().getId();
     }
 
index ea77de2ba006df399010f0a1d1a7dfc69ed1557d..de527e03857cc74ae16b01aaddf7272ade1d4f92 100644 (file)
@@ -21,14 +21,7 @@ import static org.apache.poi.sl.draw.DrawTextParagraph.HYPERLINK_HREF;
 import static org.apache.poi.sl.draw.DrawTextParagraph.HYPERLINK_LABEL;
 import static org.apache.poi.xslf.XSLFTestDataSamples.openSampleDocument;
 import static org.apache.poi.xslf.XSLFTestDataSamples.writeOutAndReadBack;
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.*;
 import static org.junit.jupiter.api.Assumptions.assumeFalse;
 
 import java.awt.Color;
@@ -288,7 +281,7 @@ class TestXSLFBugs {
                         assertEquals("rId1", rel0.getRelationship().getId());
                         assertEquals(XSLFRelation.SLIDE_LAYOUT.getRelation(), rel0.getRelationship().getRelationshipType());
                         RelationPart rel1 = rels.get(1);
-                        assertEquals("rId2", rel1.getRelationship().getId());
+                        assertNotEquals("rId1", rel1.getRelationship().getId());
                         assertEquals(XSLFRelation.IMAGES.getRelation(), rel1.getRelationship().getRelationshipType());
                     }
                 }