List<SldId> sldIds = this.getJaxbElement().getSldIdLst().getSldId();
int zeroBasedCount = sldIds.size();
if (index< 0 || index>zeroBasedCount) {
throw new Pptx4jException("Can't add slide at index " + index + ". (There are " + sldIds.size() + " slides) ");
}
try {
Relationship rel = this.addTargetPart(slidePart, AddPartBehaviour.RENAME_IF_NAME_EXISTS);
sldIds.add(index, createSlideIdListEntry(rel));
} catch (InvalidFormatException e) {
throw new Pptx4jException(e.getMessage(), e);
}
}