Examples of PersistPtrHolder


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

      Record r2 = Record.buildRecordAtOffset(
          hss.getUnderlyingBytes(),
          uea.getPersistPointersOffset()
      );
      if(! (r2 instanceof PersistPtrHolder)) { return null; }
      PersistPtrHolder pph = (PersistPtrHolder)r2;
     
      // Now get the last record
      int[] slideIds = pph.getKnownSlideIDs();
      int maxSlideId = -1;
      for(int i=0; i<slideIds.length; i++) {
        if(slideIds[i] > maxSlideId) { maxSlideId = slideIds[i]; }
      }
      if(maxSlideId == -1) { return null; }
     
      int offset = (
          (Integer)pph.getSlideLocationsLookup().get(
              new Integer(maxSlideId)
          ) ).intValue();
      Record r3 = Record.buildRecordAtOffset(
          hss.getUnderlyingBytes(),
          offset
View Full Code Here

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

  private void findMostRecentCoreRecords() {
  // To start with, find the most recent in the byte offset domain
  Hashtable mostRecentByBytes = new Hashtable();
  for(int i=0; i<_records.length; i++) {
    if(_records[i] instanceof PersistPtrHolder) {
      PersistPtrHolder pph = (PersistPtrHolder)_records[i];

      // If we've already seen any of the "slide" IDs for this
      //  PersistPtr, remove their old positions
      int[] ids = pph.getKnownSlideIDs();
      for(int j=0; j<ids.length; j++) {
        Integer id = new Integer(ids[j]);
        if( mostRecentByBytes.containsKey(id)) {
          mostRecentByBytes.remove(id);
       
      }

      // Now, update the byte level locations with their latest values
      Hashtable thisSetOfLocations = pph.getSlideLocationsLookup();
      for(int j=0; j<ids.length; j++) {
        Integer id = new Integer(ids[j]);
        mostRecentByBytes.put(id, thisSetOfLocations.get(id));
      }
    }
View Full Code Here

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

      _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.PersistPtrHolder

  private void findMostRecentCoreRecords() {
  // To start with, find the most recent in the byte offset domain
  Hashtable mostRecentByBytes = new Hashtable();
  for(int i=0; i<_records.length; i++) {
    if(_records[i] instanceof PersistPtrHolder) {
      PersistPtrHolder pph = (PersistPtrHolder)_records[i];

      // If we've already seen any of the "slide" IDs for this
      //  PersistPtr, remove their old positions
      int[] ids = pph.getKnownSlideIDs();
      for(int j=0; j<ids.length; j++) {
        Integer id = new Integer(ids[j]);
        if( mostRecentByBytes.containsKey(id)) {
          mostRecentByBytes.remove(id);
       
      }

      // Now, update the byte level locations with their latest values
      Hashtable thisSetOfLocations = pph.getSlideLocationsLookup();
      for(int j=0; j<ids.length; j++) {
        Integer id = new Integer(ids[j]);
        mostRecentByBytes.put(id, thisSetOfLocations.get(id));
      }
    }
View Full Code Here

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

      _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.PersistPtrHolder

  private void findMostRecentCoreRecords() {
  // To start with, find the most recent in the byte offset domain
  Hashtable mostRecentByBytes = new Hashtable();
  for(int i=0; i<_records.length; i++) {
    if(_records[i] instanceof PersistPtrHolder) {
      PersistPtrHolder pph = (PersistPtrHolder)_records[i];

      // If we've already seen any of the "slide" IDs for this
      //  PersistPtr, remove their old positions
      int[] ids = pph.getKnownSlideIDs();
      for(int j=0; j<ids.length; j++) {
        Integer id = new Integer(ids[j]);
        if( mostRecentByBytes.containsKey(id)) {
          mostRecentByBytes.remove(id);
       
      }

      // Now, update the byte level locations with their latest values
      Hashtable thisSetOfLocations = pph.getSlideLocationsLookup();
      for(int j=0; j<ids.length; j++) {
        Integer id = new Integer(ids[j]);
        mostRecentByBytes.put(id, thisSetOfLocations.get(id));
      }
    }
View Full Code Here

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

      Record r2 = Record.buildRecordAtOffset(
          hss.getUnderlyingBytes(),
          uea.getPersistPointersOffset()
      );
      if(! (r2 instanceof PersistPtrHolder)) { return null; }
      PersistPtrHolder pph = (PersistPtrHolder)r2;

      // Now get the last record
      int[] slideIds = pph.getKnownSlideIDs();
      int maxSlideId = -1;
      for(int i=0; i<slideIds.length; i++) {
        if(slideIds[i] > maxSlideId) { maxSlideId = slideIds[i]; }
      }
      if(maxSlideId == -1) { return null; }

      int offset = (
          (Integer)pph.getSlideLocationsLookup().get(
              new Integer(maxSlideId)
          ) ).intValue();
      Record r3 = Record.buildRecordAtOffset(
          hss.getUnderlyingBytes(),
          offset
View Full Code Here

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

        while (usrOffset != 0){
            UserEditAtom usr = (UserEditAtom) Record.buildRecordAtOffset(docstream, usrOffset);
            lst.add(Integer.valueOf(usrOffset));
            int psrOffset = usr.getPersistPointersOffset();

            PersistPtrHolder ptr = (PersistPtrHolder)Record.buildRecordAtOffset(docstream, psrOffset);
            lst.add(Integer.valueOf(psrOffset));
            Hashtable<Integer,Integer> entries = ptr.getSlideLocationsLookup();
            for(Integer id : entries.keySet()) {
                Integer offset = entries.get(id);
                lst.add(offset);
                offset2id.put(offset, id);
            }
View Full Code Here

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

        while (usrOffset != 0){
            UserEditAtom usr = (UserEditAtom) Record.buildRecordAtOffset(docstream, usrOffset);
            lst.add(usrOffset);
            int psrOffset = usr.getPersistPointersOffset();

            PersistPtrHolder ptr = (PersistPtrHolder)Record.buildRecordAtOffset(docstream, psrOffset);
            lst.add(psrOffset);
            Hashtable<Integer,Integer> entries = ptr.getSlideLocationsLookup();
            for(Integer id : entries.keySet()) {
                Integer offset = entries.get(id);
                lst.add(offset);
                offset2id.put(offset, id);
            }
View Full Code Here

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

  private void findMostRecentCoreRecords() {
    // To start with, find the most recent in the byte offset domain
    Map<Integer,Integer> mostRecentByBytes = new HashMap<Integer,Integer>();
    for (Record record : _hslfSlideShow.getRecords()) {
      if (record instanceof PersistPtrHolder) {
        PersistPtrHolder pph = (PersistPtrHolder) record;

        // If we've already seen any of the "slide" IDs for this
        // PersistPtr, remove their old positions
        int[] ids = pph.getKnownSlideIDs();
        for (int id : ids) {
          if (mostRecentByBytes.containsKey(id)) {
            mostRecentByBytes.remove(id);
          }
        }

        // Now, update the byte level locations with their latest values
        Map<Integer,Integer> thisSetOfLocations = pph.getSlideLocationsLookup();
        for (int id : ids) {
          mostRecentByBytes.put(id, thisSetOfLocations.get(id));
        }
      }
    }
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.