use of org.apache.poi.hslf.record.ExControl in project poi by apache.
the class ActiveXShape method getExControl.
/**
* 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;
}
use of org.apache.poi.hslf.record.ExControl in project poi by apache.
the class ActiveXShape method afterInsert.
@Override
protected void afterInsert(HSLFSheet sheet) {
ExControl ctrl = getExControl();
if (ctrl == null) {
throw new NullPointerException("ExControl is not defined");
}
ctrl.getExControlAtom().setSlideId(sheet._getSheetNumber());
String name = ctrl.getProgId() + "-" + getControlIndex() + '