public int addBSERecord(EscherBSERecord e) {createDrawingGroup();escherBSERecords.add( e );int dgLoc = findFirstRecordLocBySid(DrawingGroupRecord.sid);DrawingGroupRecord drawingGroup = (DrawingGroupRecord) getRecords().get( dgLoc );EscherContainerRecord dggContainer = (EscherContainerRecord) drawingGroup.getEscherRecord( 0 );EscherContainerRecord bstoreContainer;if (dggContainer.getChild( 1 ).getRecordId() == EscherContainerRecord.BSTORE_CONTAINER ){bstoreContainer = (EscherContainerRecord) dggContainer.getChild( 1 );} else {bstoreContainer = new EscherContainerRecord();bstoreContainer.setRecordId( EscherContainerRecord.BSTORE_CONTAINER );List<EscherRecord> childRecords = dggContainer.getChildRecords();childRecords.add(1, bstoreContainer);dggContainer.setChildRecords(childRecords);}bstoreContainer.setOptions( (short) ( (escherBSERecords.size() << 4) | 0xF ) );bstoreContainer.addChildRecord( e );return escherBSERecords.size();}
public int AddBSERecord(EscherBSERecord e){CreateDrawingGroup();escherBSERecords.Add(e);int dgLoc = FindFirstRecordLocBySid(DrawingGroupRecord.sid);DrawingGroupRecord drawingGroup = (DrawingGroupRecord)Records[dgLoc];EscherContainerRecord dggContainer = (EscherContainerRecord)drawingGroup.GetEscherRecord(0);EscherContainerRecord bstoreContainer;if (dggContainer.GetChild(1).RecordId == EscherContainerRecord.BSTORE_CONTAINER){bstoreContainer = (EscherContainerRecord)dggContainer.GetChild(1);}else{bstoreContainer = new EscherContainerRecord();bstoreContainer.RecordId=EscherContainerRecord.BSTORE_CONTAINER;List<EscherRecord> childRecords = dggContainer.ChildRecords;childRecords.Insert(1, bstoreContainer);dggContainer.ChildRecords = (childRecords);}bstoreContainer.Options=(short)((escherBSERecords.Count << 4) | 0xF);bstoreContainer.AddChildRecord(e);return escherBSERecords.Count;}