// 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];
if (masterSLWT != null){
masterSets = masterSLWT.getSlideAtomsSets();
ArrayList mmr = new ArrayList();
ArrayList tmr = new ArrayList();
for(int i=0; i<masterSets.length; i++) {
Record r = getCoreRecordForSAS(masterSets[i]);
SlideAtomsSet sas = masterSets[i];
int sheetNo = sas.getSlidePersistAtom().getSlideIdentifier();
if(r instanceof org.apache.poi.hslf.record.Slide) {
TitleMaster master = new TitleMaster((org.apache.poi.hslf.record.Slide)r, sheetNo);
master.setSlideShow(this);
tmr.add(master);
} else if(r instanceof org.apache.poi.hslf.record.MainMaster) {
SlideMaster master = new SlideMaster((org.apache.poi.hslf.record.MainMaster)r, sheetNo);
master.setSlideShow(this);
mmr.add(master);
}
}
_masters = new SlideMaster[mmr.size()];
mmr.toArray(_masters);
_titleMasters = new TitleMaster[tmr.size()];
tmr.toArray(_titleMasters);
}
// 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]);