assertEquals(258, s3._getSheetNumber());\r
assertEquals(3, s3.getSlideNumber());\r
\r
+ \r
//serialize and read again\r
ByteArrayOutputStream out = new ByteArrayOutputStream();\r
ppt.write(out);\r
\r
ppt = new SlideShow(new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray())));\r
assertTrue(ppt.getSlides().length == 3);\r
+ \r
+ // Check IDs are still right\r
+ s1 = ppt.getSlides()[0];\r
+ assertEquals(256, s1._getSheetNumber());\r
+ assertEquals(3, s1._getSheetRefId());\r
+ s2 = ppt.getSlides()[1];\r
+ assertEquals(257, s2._getSheetNumber());\r
+ assertEquals(4, s2._getSheetRefId());\r
+ s3 = ppt.getSlides()[2];;\r
+ assertTrue(ppt.getSlides().length == 3);\r
+ assertEquals(258, s3._getSheetNumber());\r
+ assertEquals(5, s3._getSheetRefId());\r
}\r
\r
/**\r
SlideShow ppt = new SlideShow(new HSLFSlideShow(dirname + "/basic_test_ppt_file.ppt"));\r
\r
assertTrue(ppt.getSlides().length == 2);\r
- ppt.createSlide();\r
+ \r
+ // First slide is 256 / 4\r
+ Slide s1 = ppt.getSlides()[0];\r
+ assertEquals(256, s1._getSheetNumber());\r
+ assertEquals(4, s1._getSheetRefId());\r
+ \r
+ // Last slide is 257 / 6\r
+ Slide s2 = ppt.getSlides()[1];\r
+ assertEquals(257, s2._getSheetNumber());\r
+ assertEquals(6, s2._getSheetRefId());\r
+ \r
+ // Add another slide, goes in at the end\r
+ Slide s3 = ppt.createSlide();\r
assertTrue(ppt.getSlides().length == 3);\r
+ assertEquals(258, s3._getSheetNumber());\r
+ assertEquals(8, s3._getSheetRefId());\r
\r
- //serialize and read again\r
+ \r
+ // Serialize and read again\r
ByteArrayOutputStream out = new ByteArrayOutputStream();\r
ppt.write(out);\r
out.close();\r
\r
ppt = new SlideShow(new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray())));\r
assertTrue(ppt.getSlides().length == 3);\r
+ \r
+ \r
+ // Check IDs are still right\r
+ s1 = ppt.getSlides()[0];\r
+ assertEquals(256, s1._getSheetNumber());\r
+ assertEquals(4, s1._getSheetRefId());\r
+ s2 = ppt.getSlides()[1];\r
+ assertEquals(257, s2._getSheetNumber());\r
+ assertEquals(6, s2._getSheetRefId());\r
+ s3 = ppt.getSlides()[2];;\r
+ assertTrue(ppt.getSlides().length == 3);\r
+ assertEquals(258, s3._getSheetNumber());\r
+ assertEquals(8, s3._getSheetRefId());\r
}\r
\r
}\r