diff --git a/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java b/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java index 7d18541d9..9f28049fa 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java @@ -18,6 +18,7 @@ package org.apache.poi.xslf; import static junit.framework.TestCase.assertEquals; import static org.apache.poi.POITestCase.assertContains; +import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; @@ -47,7 +48,6 @@ import org.apache.poi.xslf.usermodel.XSLFSlide; import org.apache.poi.xslf.usermodel.XSLFSlideLayout; import org.junit.Ignore; import org.junit.Test; - public class TestXSLFBugs { @Test @@ -259,6 +259,108 @@ public class TestXSLFBugs { ss.setSlideOrder(slide, 2); validateSlides(ss, true, "Slide1","Slide2","New slide"); } + + /** + * When working with >9 images, make sure the sorting ensures + * that image10.foo isn't between image1.foo and image2.foo + */ + @Test + @Ignore + public void test57552() throws Exception { + XMLSlideShow ss = new XMLSlideShow(); + for (String s : new String[]{"Slide1","Slide2"}) { + ss.createSlide().createTextBox().setText(s); + } + + // Slide starts with just layout relation + XSLFSlide slide = ss.getSlides()[0]; + assertEquals(0, ss.getAllPictures().size()); + assertEquals(1, slide.getShapes().length); + + assertEquals(1, slide.getRelations().size()); + assertRelationEquals(XSLFRelation.SLIDE_LAYOUT, slide.getRelations().get(0)); + + // Some dummy pictures + byte[][] pics = new byte[15][3]; + for (int i=0; i