Package org.apache.poi.hslf.record

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


        return shape;

    }

    protected static Record getClientDataRecord(EscherContainerRecord spContainer, int recordType) {
        Record oep = null;
        for (Iterator<EscherRecord> it = spContainer.getChildIterator(); it.hasNext();) {
            EscherRecord obj = it.next();
            if (obj.getRecordId() == EscherClientDataRecord.RECORD_ID) {
                byte[] data = obj.serialize();
                Record[] records = Record.findChildRecords(data, 8, data.length - 8);
View Full Code Here


        for (int i = 0, slwtIndex=0; i < (records.length - 1); i++) {
            if (records[i] instanceof TextHeaderAtom) {
                TextHeaderAtom tha = (TextHeaderAtom) records[i];
                StyleTextPropAtom stpa = null;
                TextRun trun = null;
                Record next = null;
                Record subs = null;
               
                // See what follows the TextHeaderAtom
                next = records[i+1];
                if (i < records.length - 2) {
                    subs = records[i+2];
View Full Code Here

    // Use the TextHeader atom to get at the parent
    RecordContainer runAtomsParent = _headerAtom.getParentRecord();

    // Add the new StyleTextPropAtom after the TextCharsAtom / TextBytesAtom
    Record addAfter = _byteAtom;
    if(_byteAtom == null) { addAfter = _charAtom; }
    runAtomsParent.addChildAfter(_styleAtom, addAfter);

    // Feed this to our sole rich text run
    if(_rtRuns.length != 1) {
View Full Code Here

        throw new CorruptPowerPointFileException("The CurrentUserAtom claims that the offset of last edit details are past the end of the file");
      }
     
      // Grab the details of the UserEditAtom there
      // If the record's messed up, we could AIOOB
      Record r = null;
      try {
        r = Record.buildRecordAtOffset(
            hss.getUnderlyingBytes(),
            (int)cua.getCurrentEditOffset()
        );
      } catch(ArrayIndexOutOfBoundsException e) {}
      if(r == null) { return null; }
      if(! (r instanceof UserEditAtom)) { return null; }
      UserEditAtom uea = (UserEditAtom)r;
     
      // Now get the 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
      );
     
      // If we have a DocumentEncryptionAtom, it'll be this one
View Full Code Here

    byte[] s_slwt = writeRecord(s_SLWT);
   
    // Check the records are the same
    assertEquals(refSLWT.getChildRecords().length, s_SLWT.getChildRecords().length);
    for(int i=0; i<refSLWT.getChildRecords().length; i++) {
      Record ref_r = refSLWT.getChildRecords()[i];
      Record s_r = s_SLWT.getChildRecords()[i];
     
      byte[] r_rb = writeRecord(ref_r);
      byte[] s_rb = writeRecord(s_r);
      assertEquals(r_rb.length, s_rb.length);
      for(int j=0; j<r_rb.length; j++) {
View Full Code Here

        //grab UserEditAtom
        UserEditAtom usredit = null;
        Record[] _records = hss_empty.getRecords();
        for (int i = 0; i < _records.length; i++) {
            Record record = _records[i];
            if(_records[i].getRecordType() == RecordTypes.UserEditAtom.typeID) {
                usredit = (UserEditAtom)_records[i];
            }
       }
       assertNotNull(usredit);
View Full Code Here

  public void testAddSlideToExisting2() throws Exception {
        //grab UserEditAtom
        UserEditAtom usredit = null;
        Record[] _records = hss_two.getRecords();
        for (int i = 0; i < _records.length; i++) {
            Record record = _records[i];
            if(_records[i].getRecordType() == RecordTypes.UserEditAtom.typeID) {
                usredit = (UserEditAtom)_records[i];
            }
       }
       assertNotNull(usredit);
View Full Code Here

         
          // Report the first 5 children, to give a flavour
          int upTo = 5;
          if(children.length < 5) { upTo = children.length; }
          for(int k=0; k<upTo; k++) {
            Record r = children[k];
            int typeID = (int)r.getRecordType();
            String typeName = RecordTypes.recordName(typeID);
            System.out.println("   - " + typeID + " (" + typeName + ")");
          }
        }
      }
View Full Code Here

    // Use the TextHeader atom to get at the parent
    RecordContainer runAtomsParent = _headerAtom.getParentRecord();

    // Add the new StyleTextPropAtom after the TextCharsAtom / TextBytesAtom
    Record addAfter = _byteAtom;
    if(_byteAtom == null) { addAfter = _charAtom; }
    runAtomsParent.addChildAfter(_styleAtom, addAfter);

    // Feed this to our sole rich text run
    if(_rtRuns.length != 1) {
View Full Code Here

        //grab UserEditAtom
        UserEditAtom usredit = null;
        Record[] _records = hss_empty.getRecords();
        for (int i = 0; i < _records.length; i++) {
            Record record = _records[i];
            if(record.getRecordType() == RecordTypes.UserEditAtom.typeID) {
                usredit = (UserEditAtom)record;
            }
       }
       assertNotNull(usredit);
View Full Code Here

TOP

Related Classes of org.apache.poi.hslf.record.Record

Copyright © 2018 www.massapicom. 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.