/** * Document-level container that specifies information about an ActiveX control * * @return container that specifies information about an ActiveX control */ public ExControl getExControl(){ int idx = getControlIndex(); Document doc = getSheet().getSlideShow().getDocumentRecord(); ExObjList lst = (ExObjList)doc.findFirstOfType(RecordTypes.ExObjList.typeID); if (lst == null) { return null; } for (Record ch : lst.getChildRecords()) { if(ch instanceof ExControl){ ExControl c = (ExControl)ch; if(c.getExOleObjAtom().getObjID() == idx){ return c; } } } return null; }
/** * Document-level container that specifies information about an ActiveX control * * @return container that specifies information about an ActiveX control */ public ExControl getExControl(){ int idx = getControlIndex(); ExControl ctrl = null; Document doc = getSheet().getSlideShow().getDocumentRecord(); ExObjList lst = (ExObjList)doc.findFirstOfType(RecordTypes.ExObjList.typeID); if(lst != null){ Record[] ch = lst.getChildRecords(); for (int i = 0; i < ch.length; i++) { if(ch[i] instanceof ExControl){ ExControl c = (ExControl)ch[i]; if(c.getExOleObjAtom().getObjID() == idx){ ctrl = c; break; } } } } return ctrl; }
Record[] ch = lst.getChildRecords(); for (int i = 0; i < ch.length; i++) { if(ch[i] instanceof ExEmbed){
/** * @return UNC or local path to a video file */ public String getPath(){ OEShapeAtom oe = (OEShapeAtom)getClientDataRecord(RecordTypes.OEShapeAtom.typeID); int idx = oe.getOptions(); SlideShow ppt = getSheet().getSlideShow(); ExObjList lst = (ExObjList)ppt.getDocumentRecord().findFirstOfType(RecordTypes.ExObjList.typeID); if(lst == null) return null; Record[] r = lst.getChildRecords(); for (int i = 0; i < r.length; i++) { if(r[i] instanceof ExMCIMovie){ ExMCIMovie mci = (ExMCIMovie)r[i]; ExVideoContainer exVideo = mci.getExVideo(); int objectId = exVideo.getExMediaAtom().getObjectId(); if(objectId == idx){ return exVideo.getPathAtom().getText(); } } } return null; } }
/** * @return UNC or local path to a video file */ @SuppressWarnings("resource") public String getPath(){ ExObjRefAtom oe = getClientDataRecord(RecordTypes.ExObjRefAtom.typeID); int idx = oe.getExObjIdRef(); HSLFSlideShow ppt = getSheet().getSlideShow(); ExObjList lst = (ExObjList)ppt.getDocumentRecord().findFirstOfType(RecordTypes.ExObjList.typeID); if(lst == null) { return null; } Record[] r = lst.getChildRecords(); for (int i = 0; i < r.length; i++) { if(r[i] instanceof ExMCIMovie){ ExMCIMovie mci = (ExMCIMovie)r[i]; ExVideoContainer exVideo = mci.getExVideo(); int objectId = exVideo.getExMediaAtom().getObjectId(); if(objectId == idx){ return exVideo.getPathAtom().getText(); } } } return null; } }
private ExEmbed getExEmbed(boolean create) { if (_exEmbed == null) { HSLFSlideShow ppt = getSheet().getSlideShow(); ExObjList lst = ppt.getDocumentRecord().getExObjList(create); if(lst == null){ LOG.log(POILogger.WARN, "ExObjList not found"); return null; } int id = getObjectID(); for (Record ch : lst.getChildRecords()) { if(ch instanceof ExEmbed){ ExEmbed embd = (ExEmbed)ch; if( embd.getExOleObjAtom().getObjID() == id) { _exEmbed = embd; } } } if (_exEmbed == null && create) { _exEmbed = new ExEmbed(); _exEmbed.getExOleObjAtom().setObjID(id); lst.appendChildRecord(_exEmbed); } } return _exEmbed; }