// Having indentified the masters, slides and notes + their orders,
// we have to go and find their matching records
// We always use the latest versions of these records, and use the
// SlideAtom/NotesAtom to match them with the StyleAtomSet
SlideListWithText masterSLWT = _documentRecord.getMasterSlideListWithText();
SlideListWithText slidesSLWT = _documentRecord.getSlideSlideListWithText();
SlideListWithText notesSLWT = _documentRecord.getNotesSlideListWithText();
// Find master slides
// These can be MainMaster records, but oddly they can also be
// Slides or Notes, and possibly even other odd stuff....
// About the only thing you can say is that the master details are in
// the first SLWT.
SlideAtomsSet[] masterSets = new SlideAtomsSet[0];
org.apache.poi.hslf.record.MainMaster[] mainMasterRecords = null;
if (masterSLWT != null){
masterSets = masterSLWT.getSlideAtomsSets();
// 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]);