Package org.apache.poi.hwpf.model

Examples of org.apache.poi.hwpf.model.PAPX


   */
  public CharacterRun insertBefore(String text, CharacterProperties props)
    //throws UnsupportedEncodingException
  {
    initAll();
    PAPX papx = (PAPX)_paragraphs.get(_parStart);
    short istd = papx.getIstd();

    StyleSheet ss = _doc.getStyleSheet();
    CharacterProperties baseStyle = ss.getCharacterStyle(istd);
    byte[] grpprl = CharacterSprmCompressor.compressCharacterProperty(props, baseStyle);
    SprmBuffer buf = new SprmBuffer(grpprl);
View Full Code Here


   */
  public CharacterRun insertAfter(String text, CharacterProperties props)
    //throws UnsupportedEncodingException
  {
    initAll();
    PAPX papx = (PAPX)_paragraphs.get(_parEnd - 1);
    short istd = papx.getIstd();

    StyleSheet ss = _doc.getStyleSheet();
    CharacterProperties baseStyle = ss.getCharacterStyle(istd);
    byte[] grpprl = CharacterSprmCompressor.compressCharacterProperty(props, baseStyle);
    SprmBuffer buf = new SprmBuffer(grpprl);
View Full Code Here

      chpx.adjustForDelete(_start, _end - _start);
    }

    for (int x = _parStart; x < numParagraphs; x++)
    {
      PAPX papx = (PAPX)_paragraphs.get(x);
      papx.adjustForDelete(_start, _end - _start);
    }

    for (int x = _sectionStart; x < numSections; x++)
    {
      SEPX sepx = (SEPX)_sections.get(x);
View Full Code Here

    initCharacterRuns();
    CHPX chpx = (CHPX)_characters.get(index + _charStart);

    int[] point = findRange(_paragraphs, _parStart, Math.max(chpx.getStart(), _start),
                              chpx.getEnd());
    PAPX papx = (PAPX)_paragraphs.get(point[0]);
    short istd = papx.getIstd();

    CharacterRun chp = new CharacterRun(chpx, _doc.getStyleSheet(), istd, this);

    return chp;
  }
View Full Code Here

   */

  public Paragraph getParagraph(int index)
  {
    initParagraphs();
    PAPX papx = (PAPX)_paragraphs.get(index + _parStart);

    ParagraphProperties props = papx.getParagraphProperties(_doc.getStyleSheet());
    Paragraph pap = null;
    if (props.getIlfo() > 0)
    {
      pap = new ListEntry(papx, this, _doc.getListTables());
    }
View Full Code Here

  protected SprmBuffer _papx;

  protected Paragraph(int startIdx, int endIdx, Table parent)
  {
    super(startIdx, endIdx, Range.TYPE_PARAGRAPH, parent);
    PAPX papx = (PAPX)_paragraphs.get(_parEnd - 1);
    _props = papx.getParagraphProperties(_doc.getStyleSheet());
    _papx = papx.getSprmBuf();
    _istd = papx.getIstd();
  }
View Full Code Here

    HWPFDocument daDoc = new HWPFDocument(new FileInputStream(illustrativeDocFile));
    Range range;
    Section section;
    Paragraph para;
    PAPX paraDef;

    // First, check overall
    range = daDoc.getOverallRange();
    assertEquals(1, range.numSections());
    assertEquals(5, range.numParagraphs());


    // Now, onto just the doc bit
    range = daDoc.getRange();

    assertEquals(1, range.numSections());
    assertEquals(1, daDoc.getSectionTable().getSections().size());
    section = range.getSection(0);

    assertEquals(5, section.numParagraphs());

    para = section.getParagraph(0);
    assertEquals(1, para.numCharacterRuns());
    assertEquals(introText, para.text());

    para = section.getParagraph(1);
    assertEquals(5, para.numCharacterRuns());
    assertEquals(fillerText, para.text());


    paraDef = (PAPX)daDoc.getParagraphTable().getParagraphs().get(2);
    assertEquals(132, paraDef.getStart());
    assertEquals(400, paraDef.getEnd());

    para = section.getParagraph(2);
    assertEquals(5, para.numCharacterRuns());
    assertEquals(originalText, para.text());


    paraDef = (PAPX)daDoc.getParagraphTable().getParagraphs().get(3);
    assertEquals(400, paraDef.getStart());
    assertEquals(438, paraDef.getEnd());

    para = section.getParagraph(3);
    assertEquals(1, para.numCharacterRuns());
    assertEquals(lastText, para.text());
View Full Code Here

   */

  public Paragraph getParagraph(int index)
  {
    initParagraphs();
    PAPX papx = (PAPX)_paragraphs.get(index + _parStart);

    ParagraphProperties props = papx.getParagraphProperties(_doc.getStyleSheet());
    Paragraph pap = null;
    if (props.getIlfo() > 0)
    {
      pap = new ListEntry(papx, this, _doc.getListTables());
    }
View Full Code Here

   */
  public CharacterRun insertBefore(String text, CharacterProperties props)
    //throws UnsupportedEncodingException
  {
    initAll();
    PAPX papx = (PAPX)_paragraphs.get(_parStart);
    short istd = papx.getIstd();

    StyleSheet ss = _doc.getStyleSheet();
    CharacterProperties baseStyle = ss.getCharacterStyle(istd);
    byte[] grpprl = CharacterSprmCompressor.compressCharacterProperty(props, baseStyle);
    SprmBuffer buf = new SprmBuffer(grpprl);
View Full Code Here

   */
  public CharacterRun insertAfter(String text, CharacterProperties props)
    //throws UnsupportedEncodingException
  {
    initAll();
    PAPX papx = (PAPX)_paragraphs.get(_parEnd - 1);
    short istd = papx.getIstd();

    StyleSheet ss = _doc.getStyleSheet();
    CharacterProperties baseStyle = ss.getCharacterStyle(istd);
    byte[] grpprl = CharacterSprmCompressor.compressCharacterProperty(props, baseStyle);
    SprmBuffer buf = new SprmBuffer(grpprl);
View Full Code Here

TOP

Related Classes of org.apache.poi.hwpf.model.PAPX

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.