If the ppt contains some slides, the creation of new slide will be failed. In your testcases, the slide's number is right, but if you use the FileOutputStream to create the file instead of the ByteArrayStream, you will see the slide does not exits although the slide's number increased.
I've just committed a new test (usermodel/TestAddingSlides), which proves that things are fine when we: * add a slide to a slideshow without one * add a slide to a slideshow with one slide * add a slide to a slideshow with two slides (and then write them out, and read them back in) Could you supply a unit test that fails, so we can see what's not working for you?
Slide adding and ordering code has been changed quite a bit since this bug was opened, and all slide addition tests pass just fine. Hopefully your problem has now been fixed. Please re-open this bug if you still have an issue.