/** * Add a new picture to this presentation. * * @return offset of this picture in the Pictures stream */ public int addPicture(HSLFPictureData img) { // Process any existing pictures if we haven't yet if (_pictures == null) { try { readPictures(); } catch (IOException e) { throw new CorruptPowerPointFileException(e.getMessage()); } } // Add the new picture in int offset = 0; if (_pictures.size() > 0) { HSLFPictureData prev = _pictures.get(_pictures.size() - 1); offset = prev.getOffset() + prev.getRawData().length + 8; } img.setOffset(offset); img.setIndex(_pictures.size() + 1); _pictures.add(img); return offset; }
pict.setIndex(_pictures.size()); _pictures.add(pict); } catch (IllegalArgumentException e) {