Examples of TextRun


Examples of org.apache.poi.hslf.model.TextRun

      return (startPos+8);
    }

    // Otherwise, check the type to see if it's text
    long type = LittleEndian.getUShort(pptContents,startPos+2);
    TextRun trun = null;

    // TextBytesAtom
    if(type == RecordTypes.TextBytesAtom.typeID) {
      TextBytesAtom tba = (TextBytesAtom)Record.createRecordForType(type, pptContents, startPos, len+8);
      trun = new TextRun((TextHeaderAtom)null,tba,(StyleTextPropAtom)null);
    }
    // TextCharsAtom
    if(type == RecordTypes.TextCharsAtom.typeID) {
      TextCharsAtom tca = (TextCharsAtom)Record.createRecordForType(type, pptContents, startPos, len+8);
      trun = new TextRun((TextHeaderAtom)null,tca,(StyleTextPropAtom)null);
    }

    // CString (doesn't go via a TextRun)
    if(type == RecordTypes.CString.typeID) {
      CString cs = (CString)Record.createRecordForType(type, pptContents, startPos, len+8);
      String text = cs.getText();

      // Ignore the ones we know to be rubbish
      if(text.equals("___PPT10")) {
      } else if(text.equals("Default Design")) {
      } else {
        textV.add(text);
      }
    }

    // If we found text via a TextRun, save it in the vector
    if(trun != null) {
      textV.add(trun.getText());
    }

    // Wind on by the atom length, and check we're not at the end
    int newPos = (startPos + 8 + len);
    if(newPos > (pptContents.length - 8)) {
View Full Code Here

Examples of org.apache.poi.hslf.model.TextRun

      }
     
      // Slide text
      TextRun[] runs = slide.getTextRuns();
      for(int j=0; j<runs.length; j++) {
        TextRun run = runs[j];
        if(run != null) {
          String text = run.getText();
          ret.append(text);
          if(! text.endsWith("\n")) {
            ret.append("\n");
          }
        }
      }
     
      // Slide footer, if set
      if(hf != null && hf.isFooterVisible() && hf.getFooterText() != null) {
        ret.append(hf.getFooterText() + "\n");
      }
     
      // Comments, if requested and present
      if(getCommentText) {
        Comment[] comments = slide.getComments();
        for(int j=0; j<comments.length; j++) {
          ret.append(
              comments[j].getAuthor() +
              " - " +
              comments[j].getText() +
              "\n"
          );
        }
      }
    }
    if(getNoteText) {
      ret.append("\n");
    }
  }

  if(getNoteText) {
    // Not currently using _notes, as that can have the notes of
    //  master sheets in. Grab Slide list, then work from there,
    //  but ensure no duplicates
    HashSet seenNotes = new HashSet();
    HeadersFooters hf = _show.getNotesHeadersFooters();
   
    for(int i=0; i<_slides.length; i++) {
      Notes notes = _slides[i].getNotesSheet();
      if(notes == null) { continue; }
      Integer id = new Integer(notes._getSheetNumber());
      if(seenNotes.contains(id)) { continue; }
      seenNotes.add(id);
     
      // Repeat the Notes header, if set
      if(hf != null && hf.isHeaderVisible() && hf.getHeaderText() != null) {
        ret.append(hf.getHeaderText() + "\n");
      }

      // Notes text
      TextRun[] runs = notes.getTextRuns();
      if(runs != null && runs.length > 0) {
        for(int j=0; j<runs.length; j++) {
          TextRun run = runs[j];
          String text = run.getText();
          ret.append(text);
          if(! text.endsWith("\n")) {
            ret.append("\n");
          }
        }
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.