}
dggContainer.setChildRecords(child);
} else {
List lst = bstore.getChildRecords();
for ( int i = 0; i < lst.size(); i++ ) {
EscherBSERecord bse = (EscherBSERecord) lst.get(i);
if (Arrays.equals(bse.getUid(), uid)){
return i + 1;
}
offset += bse.getSize();
}
}
PictureData pict = PictureData.create(format);
pict.setData(data);
pict.setOffset(offset);
EscherBSERecord bse = new EscherBSERecord();
bse.setRecordId(EscherBSERecord.RECORD_ID);
bse.setOptions( (short) ( 0x0002 | ( format << 4 ) ) );
bse.setSize(pict.getRawData().length + 8);
bse.setUid(uid);
bse.setBlipTypeMacOS((byte)format);
bse.setBlipTypeWin32((byte)format);
if (format == Picture.EMF) bse.setBlipTypeMacOS((byte)Picture.PICT);
else if (format == Picture.WMF) bse.setBlipTypeMacOS((byte)Picture.PICT);
else if (format == Picture.PICT) bse.setBlipTypeWin32((byte)Picture.WMF);
bse.setRef(1);
bse.setOffset(offset);
bstore.addChildRecord(bse);
int count = bstore.getChildRecords().size();
bstore.setOptions((short)( (count << 4) | 0xF ));