// 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<SlideMaster> mmr = new ArrayList<SlideMaster>();
ArrayList<TitleMaster> tmr = new ArrayList<TitleMaster>();
for (SlideAtomsSet sas : masterSets) {
Record r = getCoreRecordForSAS(sas);
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 = mmr.toArray(new SlideMaster[mmr.size()]);
_titleMasters = tmr.toArray(new TitleMaster[tmr.size()]);
}
// 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];
Map<Integer,Integer> slideIdToNotes = new HashMap<Integer,Integer>();
if (notesSLWT == null) {
// None
notesRecords = new org.apache.poi.hslf.record.Notes[0];
} else {
// Match up the records and the SlideAtomSets
notesSets = notesSLWT.getSlideAtomsSets();
List<org.apache.poi.hslf.record.Notes> notesRecordsL =
new ArrayList<org.apache.poi.hslf.record.Notes>();
for (int i = 0; i < notesSets.length; i++) {
// Get the right core record
Record r = getCoreRecordForSAS(notesSets[i]);