// For now, we only care about the records which are MainMasters
// (In future, we might want to know about the other too)
ArrayList mmr = new ArrayList();
for(int i=0; i<masterSets.length; i++) {
Record r = getCoreRecordForSAS(masterSets[i]);
if(r instanceof org.apache.poi.hslf.record.Slide) {
// Slide master, skip
} else if(r instanceof org.apache.poi.hslf.record.MainMaster) {
mmr.add(r);
}
}
mainMasterRecords = new org.apache.poi.hslf.record.MainMaster[mmr.size()];
mmr.toArray(mainMasterRecords);
}
// Having sorted out the masters, that leaves the notes and slides
// Start by finding the notes records to go with the entries in
// notesSLWT
org.apache.poi.hslf.record.Notes[] notesRecords;
SlideAtomsSet[] notesSets = new SlideAtomsSet[0];
Hashtable slideIdToNotes = new Hashtable();
if(notesSLWT == null) {
// None
notesRecords = new org.apache.poi.hslf.record.Notes[0];
} else {
// Match up the records and the SlideAtomSets
notesSets = notesSLWT.getSlideAtomsSets();
ArrayList notesRecordsL = new ArrayList();
for(int i=0; i<notesSets.length; i++) {
// Get the right core record
Record r = getCoreRecordForSAS(notesSets[i]);
// Ensure it really is a notes record
if(r != null && r instanceof org.apache.poi.hslf.record.Notes) {
notesRecordsL.add( (org.apache.poi.hslf.record.Notes)r );
// Record the match between slide id and these notes
SlidePersistAtom spa = notesSets[i].getSlidePersistAtom();
Integer slideId = new Integer(spa.getSlideIdentifier());
slideIdToNotes.put(slideId, new Integer(i));
} else {
logger.log(POILogger.ERROR, "A Notes SlideAtomSet at " + i + " said its record was at refID " + notesSets[i].getSlidePersistAtom().getRefID() + ", but that was actually a " + r);
}
}
notesRecords = new org.apache.poi.hslf.record.Notes[notesRecordsL.size()];
notesRecords = (org.apache.poi.hslf.record.Notes[])
notesRecordsL.toArray(notesRecords);
}
// Now, do the same thing for our slides
org.apache.poi.hslf.record.Slide[] slidesRecords;
SlideAtomsSet[] slidesSets = new SlideAtomsSet[0];
if(slidesSLWT == null) {
// None
slidesRecords = new org.apache.poi.hslf.record.Slide[0];
} else {
// Match up the records and the SlideAtomSets
slidesSets = slidesSLWT.getSlideAtomsSets();
slidesRecords = new org.apache.poi.hslf.record.Slide[slidesSets.length];
for(int i=0; i<slidesSets.length; i++) {
// Get the right core record
Record r = getCoreRecordForSAS(slidesSets[i]);
// Ensure it really is a slide record
if(r instanceof org.apache.poi.hslf.record.Slide) {
slidesRecords[i] = (org.apache.poi.hslf.record.Slide)r;
} else {