From e7c94a114b83480b0561355f65564aa1e87234b8 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Tue, 9 Jan 2007 18:51:29 +0000 Subject: [PATCH] Update with new knowledge of how this all works, from bug #41176 git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@494519 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/hslf/usermodel/SlideShow.java | 49 ++++++------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java index efb666faf..400eecdc3 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java @@ -305,53 +305,36 @@ public class SlideShow // 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 - // - // Some crazy documents don't have a master SlideListWithText, their - // first one is the slide containing one, which makes things fun... SlideListWithText masterSLWT = _documentRecord.getMasterSlideListWithText(); SlideListWithText slidesSLWT = _documentRecord.getSlideSlideListWithText(); SlideListWithText notesSLWT = _documentRecord.getNotesSlideListWithText(); - + // Find master slides - // Need to ensure they're really master slides, and we're not dealing - // with a crazy document that doesn't have any 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[] masterRecords = null; + org.apache.poi.hslf.record.MainMaster[] mainMasterRecords = null; if (masterSLWT != null){ masterSets = masterSLWT.getSlideAtomsSets(); - // Are they Slides, Master Slides, or some broken mix? - int slideCount = 0; - int masterCount = 0; + // 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 0 && masterCount == 0) { - // Actually the Slide SlideListWithTexts - notesSLWT = slidesSLWT; - slidesSLWT = masterSLWT; - masterSLWT = null; - } else if(masterCount >= 0 && slideCount == 0) { - // Is a normal, proper Masters SlideListWithTexts - masterRecords = new org.apache.poi.hslf.record.MainMaster[masterSets.length]; - - // Grab the Main Master records - for(int i=0; i