diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java b/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java index 334208987..57efcb0df 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java @@ -73,9 +73,18 @@ public abstract class Sheet public SlideShow getSlideShow() { return _slideShow; } /** - * Set the SlideShow we're attached to + * Set the SlideShow we're attached to. + * Also passes it on to our child RichTextRuns */ - public void setSlideShow(SlideShow ss) { _slideShow = ss; } + public void setSlideShow(SlideShow ss) { + _slideShow = ss; + TextRun[] trs = getTextRuns(); + if(trs != null) { + for(int i=0; i 0) { - // Get the SlideIdentifier of the Notes - // (Note - might not be the same as the SlideIdentifier of the Slide) - int notesSlideIdentifier = s.getSlideAtom().getNotesID(); - Integer notesSlideIdentifierI = new Integer(notesSlideIdentifier); - - // Grab the notes record - Integer notesRefI = (Integer)notesSlideIdToRefid.get(notesSlideIdentifierI); - Integer notesCoreRecNum = (Integer)_sheetIdToCoreRecordsLookup.get(notesRefI); - n = (org.apache.poi.hslf.record.Notes) - _mostRecentCoreRecords[notesCoreRecNum.intValue()]; - } - - // Grab the matching SlideAtomSet - SlideAtomsSet sas = (SlideAtomsSet) - slideSlideIdToSlideAtomsSet.get(slideIdentifierI); - - // Build the notes model, if there's notes - Notes notes = null; - if(n != null) { - // TODO: Use this - SlideAtomsSet nsas = (SlideAtomsSet) - notesSlideIdToSlideAtomsSet.get(slideIdentifierI); - - // Create the model view of the notes - notes = new Notes(n); - notesV.add(notes); - } - - // Build the slide model - Slide slide = new Slide(s, notes, sas, slideIdentifier, slideNumber); - slidesV.add(slide); - } - - // ******************* Finish up **************** - - // Finish setting up the notes - _notes = new Notes[notesV.size()]; + // Finally, generate model objects for everything + // Notes first + _notes = new Notes[notesRecords.length]; for(int i=0; i<_notes.length; i++) { - _notes[i] = (Notes)notesV.get(i); + _notes[i] = new Notes(notesRecords[i]); _notes[i].setSlideShow(this); - - // Now supply ourselves to all the rich text runs - // of this note's TextRuns - TextRun[] trs = _notes[i].getTextRuns(); - for(int j=0; j