text: public NameXPtg addNameXPtg(String name) {int extBlockIndex = -1;ExternalBookBlock extBlock = null;for (int i = 0; i < _externalBookBlocks.length; i++) {SupBookRecord ebr = _externalBookBlocks[i].getExternalBookRecord();if (ebr.isAddInFunctions()) {extBlock = _externalBookBlocks[i];extBlockIndex = i;break;}}if (extBlock == null) {extBlock = new ExternalBookBlock();extBlockIndex = extendExternalBookBlocks(extBlock);int idx = findFirstRecordLocBySid(ExternSheetRecord.sid);_workbookRecordList.add(idx, extBlock.getExternalBookRecord());_externSheetRecord.addRef(_externalBookBlocks.length - 1, -2, -2);}ExternalNameRecord extNameRecord = new ExternalNameRecord();extNameRecord.setText(name);extNameRecord.setParsedExpression(new Ptg[]{ErrPtg.REF_INVALID});int nameIndex = extBlock.addExternalName(extNameRecord);int supLinkIndex = 0;for (org.apache.poi.hssf.record.Record record : _workbookRecordList.getRecords()) {if (record instanceof SupBookRecord && ((SupBookRecord) record).isAddInFunctions()) {break;}supLinkIndex++;}int numberOfNames = extBlock.getNumberOfNames();_workbookRecordList.add(supLinkIndex + numberOfNames, extNameRecord);int fakeSheetIdx = -2; int ix = _externSheetRecord.getRefIxForSheet(extBlockIndex, fakeSheetIdx, fakeSheetIdx);return new NameXPtg(ix, nameIndex);}