Examples of SlideListWithText


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

    if(oldSlideNumer > _slides.length || newSlideNumber > _slides.length) {
      throw new IllegalArgumentException("Old and new slide numbers must not exceed the number of slides (" + _slides.length + ")");
    }
   
    // Shift the SlideAtomsSet
    SlideListWithText slwt = _documentRecord.getSlideSlideListWithText();
    slwt.repositionSlideAtomsSet(
        slwt.getSlideAtomsSets()[(oldSlideNumer-1)],
        (newSlideNumber-1)
    );
   
    // Re-order the slides
    ArrayUtil.arrayMoveWithin(_slides, (oldSlideNumer-1), (newSlideNumber-1), 1);
View Full Code Here

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

   *
   * @return  the created <code>Slide</code>
   * @throws IOException
   */
    public Slide createSlide() throws IOException {
      SlideListWithText slist = null;

      // We need to add the records to the SLWT that deals
      //  with Slides.
      // Add it, if it doesn't exist
      slist = _documentRecord.getSlideSlideListWithText();
      if(slist == null) {
        // Need to add a new one
        slist = new SlideListWithText();
        _documentRecord.addSlideListWithText(slist);
      }

      // 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();

      // 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);
View Full Code Here

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

  private void assertMatchesSLTWC(SlideShow s) throws Exception {
    // Grab a new copy of slideshow C
    SlideShow refC = new SlideShow(new HSLFSlideShow(filenameC));

    // Write out the 2nd SLWT in the active document
    SlideListWithText refSLWT = refC.getDocumentRecord().getSlideListWithTexts()[1];
    byte[] raw_slwt = writeRecord(refSLWT);
   
    // Write out the same for the supplied slideshow
    SlideListWithText s_SLWT = s.getDocumentRecord().getSlideListWithTexts()[1];
    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

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

   * @return  the created <code>Slide</code>
   * @throws IOException
   */
    public Slide createSlide() throws IOException {
      SlideListWithText[] slwts = _documentRecord.getSlideListWithTexts();
      SlideListWithText slist = null;
     
      if(slwts.length > 1) {
        // Just use the last one
        slist = slwts[slwts.length - 1];
      } else {
        // Need to add a new one
        slist = new SlideListWithText();
        _documentRecord.addSlideListWithText(slist);
        slwts = _documentRecord.getSlideListWithTexts();
      }

      // 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(int i=0; i<slwts.length; i++) {
        SlideAtomsSet[] sas = slwts[i].getSlideAtomsSets();
        for(int j=0; j<sas.length; j++) {
          SlidePersistAtom spa = sas[j].getSlidePersistAtom();
          if(spa.getSlideIdentifier() < 0) {
            // This is for a master slide
          } 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
View Full Code Here

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

   * @return  the created <code>Slide</code>
   * @throws IOException
   */
    public Slide createSlide() throws IOException {
      SlideListWithText[] slwts = _documentRecord.getSlideListWithTexts();
      SlideListWithText slist = null;
     
      if(slwts.length > 1) {
        // Just use the last one
        slist = slwts[slwts.length - 1];
      } else {
        // Need to add a new one
        slist = new SlideListWithText();
        _documentRecord.addSlideListWithText(slist);
        slwts = _documentRecord.getSlideListWithTexts();
      }

      // 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(int i=0; i<slwts.length; i++) {
        SlideAtomsSet[] sas = slwts[i].getSlideAtomsSets();
        for(int j=0; j<sas.length; j++) {
          SlidePersistAtom spa = sas[j].getSlidePersistAtom();
          if(spa.getSlideIdentifier() < 0) {
            // This is for a master slide
          } 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
View Full Code Here

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

  private void assertMatchesSLTWC(SlideShow s) throws Exception {
    // Grab a new copy of slideshow C
    SlideShow refC = new SlideShow(_slTests.openResourceAsStream(filenameC));

    // Write out the 2nd SLWT in the active document
    SlideListWithText refSLWT = refC.getDocumentRecord().getSlideListWithTexts()[1];
    byte[] raw_slwt = writeRecord(refSLWT);

    // Write out the same for the supplied slideshow
    SlideListWithText s_SLWT = s.getDocumentRecord().getSlideListWithTexts()[1];
    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

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

          System.err.println("** Warning: Shouldn't have more than 3!");
        }

        // Check the SLWTs contain what we'd expect
        for(int j=0; j<slwts.length; j++) {
          SlideListWithText slwt = slwts[j];
          Record[] children = slwt.getChildRecords();

          System.out.println(" - SLWT at " + j + " had " + children.length + " children:");

          // Should only have SlideAtomSets if the second one
          int numSAS = slwt.getSlideAtomsSets().length;
          if(j == 1) {
            if(numSAS == 0) {
              System.err.println("  ** 2nd SLWT didn't have any SlideAtomSets!");
            } else {
              System.out.println("  - Contains " + numSAS + " SlideAtomSets");
View Full Code Here

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

  private void assertMatchesSLTWC(SlideShow s) throws Exception {
    // Grab a new copy of slideshow C
    SlideShow refC = new SlideShow(new HSLFSlideShow(filenameC));

    // Write out the 2nd SLWT in the active document
    SlideListWithText refSLWT = refC.getDocumentRecord().getSlideListWithTexts()[1];
    byte[] raw_slwt = writeRecord(refSLWT);
   
    // Write out the same for the supplied slideshow
    SlideListWithText s_SLWT = s.getDocumentRecord().getSlideListWithTexts()[1];
    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

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

  private void assertMatchesSLTWC(SlideShow s) throws Exception {
    // Grab a new copy of slideshow C
    SlideShow refC = new SlideShow(new HSLFSlideShow(filenameC));

    // Write out the 2nd SLWT in the active document
    SlideListWithText refSLWT = refC.getDocumentRecord().getSlideListWithTexts()[1];
    byte[] raw_slwt = writeRecord(refSLWT);
   
    // Write out the same for the supplied slideshow
    SlideListWithText s_SLWT = s.getDocumentRecord().getSlideListWithTexts()[1];
    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

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

  private void assertMatchesSLTWC(SlideShow s) throws Exception {
    // Grab a new copy of slideshow C
    SlideShow refC = new SlideShow(_slTests.openResourceAsStream(filenameC));

    // Write out the 2nd SLWT in the active document
    SlideListWithText refSLWT = refC.getDocumentRecord().getSlideListWithTexts()[1];
    byte[] raw_slwt = writeRecord(refSLWT);

    // Write out the same for the supplied slideshow
    SlideListWithText s_SLWT = s.getDocumentRecord().getSlideListWithTexts()[1];
    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
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.