/** * Returns the ExObjList, which holds the references to * external objects used in the slides. This may be null, if * there are no external references. * * @param create if true, create an ExObjList if it doesn't exist */ public ExObjList getExObjList(boolean create) { if (exObjList == null && create) { exObjList = new ExObjList(); addChildAfter(exObjList, getDocumentAtom()); } return exObjList; }
/** * Attach this HeadersFootersContainer to the parent Document record */ private void attach(){ Document doc = _ppt.getDocumentRecord(); Record[] ch = doc.getChildRecords(); Record lst = null; for (int i=0; i < ch.length; i++){ if(ch[i].getRecordType() == RecordTypes.List.typeID){ lst = ch[i]; break; } } doc.addChildAfter(_container, lst); _newRecord = false; }
public HeadersFooters(HSLFSheet sheet, short headerFooterType) { _sheet = sheet; @SuppressWarnings("resource") HSLFSlideShow ppt = _sheet.getSlideShow(); Document doc = ppt.getDocumentRecord(); // detect if this ppt was saved in Office2007 String tag = ppt.getSlideMasters().get(0).getProgrammableTag(); _ppt2007 = _ppt2007tag.equals(tag); SheetContainer sc = _sheet.getSheetContainer(); HeadersFootersContainer hdd = (HeadersFootersContainer)sc.findFirstOfType(RecordTypes.HeadersFooters.typeID); // boolean ppt2007 = sc.findFirstOfType(RecordTypes.RoundTripContentMasterId.typeID) != null; if (hdd == null) { for (Record ch : doc.getChildRecords()) { if (ch instanceof HeadersFootersContainer && ((HeadersFootersContainer) ch).getOptions() == headerFooterType) { hdd = (HeadersFootersContainer) ch; break; } } } if (hdd == null) { hdd = new HeadersFootersContainer(headerFooterType); Record lst = doc.findFirstOfType(RecordTypes.List.typeID); doc.addChildAfter(hdd, lst); } _container = hdd; }
if (lst == null) { lst = new ExObjList(); _documentRecord.addChildAfter(lst, _documentRecord.getDocumentAtom()); try { Field f = Document.class.getDeclaredField("exObjList");
if (lst == null) { lst = new ExObjList(); _documentRecord.addChildAfter(lst, _documentRecord.getDocumentAtom());
/** * Add a hyperlink to this presentation * * @return 0-based index of the hyperlink */ public int addHyperlink(Hyperlink link) { ExObjList lst = (ExObjList) _documentRecord.findFirstOfType(RecordTypes.ExObjList.typeID); if (lst == null) { lst = new ExObjList(); _documentRecord.addChildAfter(lst, _documentRecord.getDocumentAtom()); } ExObjListAtom objAtom = lst.getExObjListAtom(); // increment the object ID seed int objectId = (int) objAtom.getObjectIDSeed() + 1; objAtom.setObjectIDSeed(objectId); ExHyperlink ctrl = new ExHyperlink(); ExHyperlinkAtom obj = ctrl.getExHyperlinkAtom(); obj.setNumber(objectId); ctrl.setLinkURL(link.getAddress()); ctrl.setLinkTitle(link.getTitle()); lst.addChildAfter(ctrl, objAtom); link.setId(objectId); return objectId; } }
if (lst == null) { lst = new ExObjList(); _documentRecord.addChildAfter(lst, _documentRecord.getDocumentAtom());