Examples of SlidePersistAtom


Examples of org.apache.poi.hslf.record.SlidePersistAtom

    /**
     * For a given SlideAtomsSet, return the core record, based on the refID from the
     *  SlidePersistAtom
     */
  private Record getCoreRecordForSAS(SlideAtomsSet sas) {
    SlidePersistAtom spa = sas.getSlidePersistAtom();
    int refID = spa.getRefID();
    return getCoreRecordForRefID(refID);
  }
View Full Code Here

Examples of org.apache.poi.hslf.record.SlidePersistAtom

      // Ensure it really is a notes record
      if(r != null && r instanceof org.apache.poi.hslf.record.Notes) {
        notesRecordsL.add( (org.apache.poi.hslf.record.Notes)r );
       
        // Record the match between slide id and these notes
        SlidePersistAtom spa = notesSets[i].getSlidePersistAtom();
        Integer slideId = new Integer(spa.getSlideIdentifier());
        slideIdToNotes.put(slideId, new Integer(i));
      } else {
        logger.log(POILogger.ERROR, "A Notes SlideAtomSet at " + i + " said its record was at refID " + notesSets[i].getSlidePersistAtom().getRefID() + ", but that was actually a " + r);
      }
    }
View Full Code Here

Examples of org.apache.poi.hslf.record.SlidePersistAtom

      }

      // Grab the SlidePersistAtom with the highest Slide Number.
      // (Will stay as null if no SlidePersistAtom exists yet in
      //  the slide, or only master slide's ones do)
      SlidePersistAtom prev = null;
    SlideAtomsSet[] sas = slist.getSlideAtomsSets();
      for(int j=0; j<sas.length; j++) {
        SlidePersistAtom spa = sas[j].getSlidePersistAtom();
        if(spa.getSlideIdentifier() < 0) {
          // This is for a master slide
          // Odd, since we only deal with the Slide SLWT
        } else {
        // Must be for a real slide
          if(prev == null) { prev = spa; }
          if(prev.getSlideIdentifier() < spa.getSlideIdentifier()) {
            prev = spa;
          }
        }
      }
     
      // Set up a new  SlidePersistAtom for this slide
      SlidePersistAtom sp = new SlidePersistAtom();

      // Reference is the 1-based index of the slide container in
      //  the PersistPtr root.
      // It always starts with 3 (1 is Document, 2 is MainMaster, 3 is
      //  the first slide), but quicksaves etc can leave gaps
      _highestSheetId++;
      sp.setRefID(_highestSheetId);
      // First slideId is always 256
      sp.setSlideIdentifier(prev == null ? 256 : (prev.getSlideIdentifier() + 1));
     
      // Add this new SlidePersistAtom to the SlideListWithText
      slist.addSlidePersistAtom(sp);
     
     
      // Create a new Slide
      Slide slide = new Slide(sp.getSlideIdentifier(), sp.getRefID(), _slides.length+1);
      // Add in to the list of Slides
      Slide[] s = new Slide[_slides.length+1];
      System.arraycopy(_slides, 0, s, 0, _slides.length);
      s[_slides.length] = slide;
      _slides = s;
      logger.log(POILogger.INFO, "Added slide " + _slides.length + " with ref " + sp.getRefID() + " and identifier " + sp.getSlideIdentifier());
     
      // Add the core records for this new Slide to the record tree
      org.apache.poi.hslf.record.Slide slideRecord = slide.getSlideRecord();
      slideRecord.setSheetId(sp.getRefID());
      int slideRecordPos = _hslfSlideShow.appendRootLevelRecord(slideRecord);
      _records = _hslfSlideShow.getRecords();

      // Add the new Slide into the PersistPtr stuff
      int offset = 0;
      int slideOffset = 0;
      PersistPtrHolder ptr = null;
      UserEditAtom usr = null;
      for (int i = 0; i < _records.length; i++) {
        Record record = _records[i];
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        record.writeOut(out);
       
        // Grab interesting records as they come past
        if(_records[i].getRecordType() == RecordTypes.PersistPtrIncrementalBlock.typeID){
          ptr = (PersistPtrHolder)_records[i];
        }
        if(_records[i].getRecordType() == RecordTypes.UserEditAtom.typeID) {
          usr = (UserEditAtom)_records[i];
        }
       
        if(i == slideRecordPos) {
          slideOffset = offset;
        }
        offset += out.size();
      }
     
    // Add the new slide into the last PersistPtr
      // (Also need to tell it where it is)
    slideRecord.setLastOnDiskOffset(slideOffset);
    ptr.addSlideLookup(sp.getRefID(), slideOffset);
    logger.log(POILogger.INFO, "New slide ended up at " + slideOffset);

    // Last view is now of the slide
      usr.setLastViewType((short)UserEditAtom.LAST_VIEW_SLIDE_VIEW);
     
View Full Code Here

Examples of org.apache.poi.hslf.record.SlidePersistAtom

    /**
     * For a given SlideAtomsSet, return the core record, based on the refID from the
     *  SlidePersistAtom
     */
  private Record getCoreRecordForSAS(SlideAtomsSet sas) {
    SlidePersistAtom spa = sas.getSlidePersistAtom();
    int refID = spa.getRefID();
    return getCoreRecordForRefID(refID);
  }
View Full Code Here

Examples of org.apache.poi.hslf.record.SlidePersistAtom

      } else {
        logger.log(POILogger.ERROR, "A Notes SlideAtomSet at " + i + " said its record was at refID " + notesSets[i].getSlidePersistAtom().getRefID() + ", but that was actually a " + r);
      }
     
      // Record the match between slide id and these notes
      SlidePersistAtom spa = notesSets[i].getSlidePersistAtom();
      Integer slideId = new Integer(spa.getSlideIdentifier());
      slideIdToNotes.put(slideId, new Integer(i));
    }
  }
 
  // Now, do the same thing for our slides
View Full Code Here

Examples of org.apache.poi.hslf.record.SlidePersistAtom

      }

      // Grab the SlidePersistAtom with the highest Slide Number.
      // (Will stay as null if no SlidePersistAtom exists yet in
      //  the slide, or only master slide's ones do)
      SlidePersistAtom prev = null;
    SlideAtomsSet[] sas = slist.getSlideAtomsSets();
      for(int j=0; j<sas.length; j++) {
        SlidePersistAtom spa = sas[j].getSlidePersistAtom();
        if(spa.getSlideIdentifier() < 0) {
          // This is for a master slide
          // Odd, since we only deal with the Slide SLWT
        } else {
        // Must be for a real slide
          if(prev == null) { prev = spa; }
          if(prev.getSlideIdentifier() < spa.getSlideIdentifier()) {
            prev = spa;
          }
        }
      }
     
      // Set up a new  SlidePersistAtom for this slide
      SlidePersistAtom sp = new SlidePersistAtom();

      // Reference is the 1-based index of the slide container in
      //  the PersistPtr root.
      // It always starts with 3 (1 is Document, 2 is MainMaster, 3 is
      //  the first slide), but quicksaves etc can leave gaps
      _highestSheetId++;
      sp.setRefID(_highestSheetId);
      // First slideId is always 256
      sp.setSlideIdentifier(prev == null ? 256 : (prev.getSlideIdentifier() + 1));
     
      // Add this new SlidePersistAtom to the SlideListWithText
      slist.addSlidePersistAtom(sp);
     
     
      // Create a new Slide
      Slide slide = new Slide(sp.getSlideIdentifier(), sp.getRefID(), _slides.length+1);
      // Add in to the list of Slides
      Slide[] s = new Slide[_slides.length+1];
      System.arraycopy(_slides, 0, s, 0, _slides.length);
      s[_slides.length] = slide;
      _slides = s;
      logger.log(POILogger.INFO, "Added slide " + _slides.length + " with ref " + sp.getRefID() + " and identifier " + sp.getSlideIdentifier());
     
      // Add the core records for this new Slide to the record tree
      org.apache.poi.hslf.record.Slide slideRecord = slide.getSlideRecord();
      slideRecord.setSheetId(sp.getRefID());
      int slideRecordPos = _hslfSlideShow.appendRootLevelRecord(slideRecord);
      _records = _hslfSlideShow.getRecords();

      // Add the new Slide into the PersistPtr stuff
      int offset = 0;
      int slideOffset = 0;
      PersistPtrHolder ptr = null;
      UserEditAtom usr = null;
      for (int i = 0; i < _records.length; i++) {
        Record record = _records[i];
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        record.writeOut(out);
       
        // Grab interesting records as they come past
        if(_records[i].getRecordType() == RecordTypes.PersistPtrIncrementalBlock.typeID){
          ptr = (PersistPtrHolder)_records[i];
        }
        if(_records[i].getRecordType() == RecordTypes.UserEditAtom.typeID) {
          usr = (UserEditAtom)_records[i];
        }
       
        if(i == slideRecordPos) {
          slideOffset = offset;
        }
        offset += out.size();
      }
     
    // Add the new slide into the last PersistPtr
      // (Also need to tell it where it is)
    slideRecord.setLastOnDiskOffset(slideOffset);
    ptr.addSlideLookup(sp.getRefID(), slideOffset);
    logger.log(POILogger.INFO, "New slide ended up at " + slideOffset);

    // Last view is now of the slide
      usr.setLastViewType((short)UserEditAtom.LAST_VIEW_SLIDE_VIEW);
     
View Full Code Here

Examples of org.apache.poi.hslf.record.SlidePersistAtom

  /**
   * For a given SlideAtomsSet, return the core record, based on the refID
   * from the SlidePersistAtom
   */
  private Record getCoreRecordForSAS(SlideAtomsSet sas) {
    SlidePersistAtom spa = sas.getSlidePersistAtom();
    int refID = spa.getRefID();
    return getCoreRecordForRefID(refID);
  }
View Full Code Here

Examples of org.apache.poi.hslf.record.SlidePersistAtom

            // don't work anymore
          org.apache.poi.hslf.record.Notes notesRecord = (org.apache.poi.hslf.record.Notes) r;
          notesRecordsL.add(notesRecord);

          // Record the match between slide id and these notes
          SlidePersistAtom spa = notesSets[i].getSlidePersistAtom();
          int slideId = spa.getSlideIdentifier();
          slideIdToNotes.put(slideId, i);
        } else {
          logger.log(POILogger.ERROR, "A Notes SlideAtomSet at " + i
              + " said its record was at refID "
              + notesSets[i].getSlidePersistAtom().getRefID()
View Full Code Here

Examples of org.apache.poi.hslf.record.SlidePersistAtom

    }

    // Grab the SlidePersistAtom with the highest Slide Number.
    // (Will stay as null if no SlidePersistAtom exists yet in
    // the slide, or only master slide's ones do)
    SlidePersistAtom prev = null;
    for (SlideAtomsSet sas : slist.getSlideAtomsSets()) {
      SlidePersistAtom spa = sas.getSlidePersistAtom();
      if (spa.getSlideIdentifier() < 0) {
        // This is for a master slide
        // Odd, since we only deal with the Slide SLWT
      } else {
        // Must be for a real slide
        if (prev == null) {
          prev = spa;
        }
        if (prev.getSlideIdentifier() < spa.getSlideIdentifier()) {
          prev = spa;
        }
      }
    }

    // Set up a new SlidePersistAtom for this slide
    SlidePersistAtom sp = new SlidePersistAtom();

    // First slideId is always 256
    sp.setSlideIdentifier(prev == null ? 256 : (prev.getSlideIdentifier() + 1));

    // Add this new SlidePersistAtom to the SlideListWithText
    slist.addSlidePersistAtom(sp);

    // Create a new Slide
    Slide slide = new Slide(sp.getSlideIdentifier(), sp.getRefID(), _slides.length + 1);
    slide.setSlideShow(this);
    slide.onCreate();

    // Add in to the list of Slides
    Slide[] s = new Slide[_slides.length + 1];
    System.arraycopy(_slides, 0, s, 0, _slides.length);
    s[_slides.length] = slide;
    _slides = s;
    logger.log(POILogger.INFO, "Added slide " + _slides.length + " with ref " + sp.getRefID()
        + " and identifier " + sp.getSlideIdentifier());

    // Add the core records for this new Slide to the record tree
    org.apache.poi.hslf.record.Slide slideRecord = slide.getSlideRecord();
    int psrId = addPersistentObject(slideRecord);
    sp.setRefID(psrId);
    slideRecord.setSheetId(psrId);
   
    slide.setMasterSheet(_masters[0]);
    // All done and added
    return slide;
View Full Code Here

Examples of org.apache.poi.hslf.record.SlidePersistAtom

  //  SlideAtomSets
  for(int i=0; i<slwts.length; i++) {
    SlideAtomsSet[] sas = slwts[i].getSlideAtomsSets();
    for(int j=0; j<sas.length; j++) {
      // What does this SlidePersistAtom point to?
      SlidePersistAtom spa = sas[j].getSlidePersistAtom();
      Integer slideIdentifier = new Integer( spa.getSlideIdentifier() );
      Integer slideRefId = new Integer( spa.getRefID() );
     
      // Grab the record it points to
      Integer coreRecordId = (Integer)
        _sheetIdToCoreRecordsLookup.get(slideRefId);
      Record r = _mostRecentCoreRecords[coreRecordId.intValue()];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.