Package org.apache.poi.hwpf.model

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


  {
    initAll();
    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);
    _doc.getCharacterTable().insert(_charStart, _start, buf);

    return insertBefore(text);
View Full Code Here


  {
    initAll();
    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);
    _doc.getCharacterTable().insert(_charEnd, _end, buf);
    _charEnd++;
    return insertAfter(text);
View Full Code Here

   */
  protected Paragraph insertBefore(ParagraphProperties props, int styleIndex, String text)
  // throws UnsupportedEncodingException
  {
    initAll();
    StyleSheet ss = _doc.getStyleSheet();
    ParagraphProperties baseStyle = ss.getParagraphStyle(styleIndex);
    CharacterProperties baseChp = ss.getCharacterStyle(styleIndex);

    byte[] grpprl = ParagraphSprmCompressor.compressParagraphProperty(props, baseStyle);
    byte[] withIndex = new byte[grpprl.length + LittleEndian.SHORT_SIZE];
    LittleEndian.putShort(withIndex, (short) styleIndex);
    System.arraycopy(grpprl, 0, withIndex, LittleEndian.SHORT_SIZE, grpprl.length);
View Full Code Here

   */
  protected Paragraph insertAfter(ParagraphProperties props, int styleIndex, String text)
  // throws UnsupportedEncodingException
  {
    initAll();
    StyleSheet ss = _doc.getStyleSheet();
    ParagraphProperties baseStyle = ss.getParagraphStyle(styleIndex);
    CharacterProperties baseChp = ss.getCharacterStyle(styleIndex);

    byte[] grpprl = ParagraphSprmCompressor.compressParagraphProperty(props, baseStyle);
    byte[] withIndex = new byte[grpprl.length + LittleEndian.SHORT_SIZE];
    LittleEndian.putShort(withIndex, (short) styleIndex);
    System.arraycopy(grpprl, 0, withIndex, LittleEndian.SHORT_SIZE, grpprl.length);
View Full Code Here

    _pictures = new PicturesTable(this, _dataStream, _mainStream, _fspa, _dgg);
    // And the art shapes stream
    _officeArts = new ShapesTable(_tableStream, _fib);

    _st = new SectionTable(_mainStream, _tableStream, _fib.getFcPlcfsed(), _fib.getLcbPlcfsed(), fcMin, _tpt, _cpSplit);
    _ss = new StyleSheet(_tableStream, _fib.getFcStshf());
    _ft = new FontTable(_tableStream, _fib.getFcSttbfffn(), _fib.getLcbSttbfffn());

    int listOffset = _fib.getFcPlcfLst();
    int lfoOffset = _fib.getFcPlfLfo();
    if (listOffset != 0 && _fib.getLcbPlcfLst() != 0)
View Full Code Here

  public void test() throws IOException {
    HWPFDocument doc = HWPFTestDataSamples.openSampleFile("Bug49820.doc");
   
    Range documentRange = doc.getRange();
    StyleSheet styleSheet = doc.getStyleSheet();
   
    // JUnit asserts
    assertLevels(documentRange, styleSheet, 0, 0, 0);
    assertLevels(documentRange, styleSheet, 1, 1, 1);
    assertLevels(documentRange, styleSheet, 2, 2, 2);
View Full Code Here

    */
   public void testListEntryNoListTable() {
      HWPFDocument doc = HWPFTestDataSamples.openSampleFile("ListEntryNoListTable.doc");

      Range r = doc.getRange();
      StyleSheet styleSheet = doc.getStyleSheet();
      for (int x = 0; x < r.numSections(); x++) {
         Section s = r.getSection(x);
         for (int y = 0; y < s.numParagraphs(); y++) {
            Paragraph paragraph = s.getParagraph(y);
            // System.out.println(paragraph.getCharacterRun(0).text());
View Full Code Here

    */
   public void testSprmAIOOB() {
      HWPFDocument doc = HWPFTestDataSamples.openSampleFile("AIOOB-Tap.doc");

      Range r = doc.getRange();
      StyleSheet styleSheet = doc.getStyleSheet();
      for (int x = 0; x < r.numSections(); x++) {
         Section s = r.getSection(x);
         for (int y = 0; y < s.numParagraphs(); y++) {
            Paragraph paragraph = s.getParagraph(y);
            // System.out.println(paragraph.getCharacterRun(0).text());
View Full Code Here

    */
   public void testListEntryNoListTable() {
      HWPFDocument doc = HWPFTestDataSamples.openSampleFile("ListEntryNoListTable.doc");

      Range r = doc.getRange();
      StyleSheet styleSheet = doc.getStyleSheet();
      for (int x = 0; x < r.numSections(); x++) {
         Section s = r.getSection(x);
         for (int y = 0; y < s.numParagraphs(); y++) {
            Paragraph paragraph = s.getParagraph(y);
            // System.out.println(paragraph.getCharacterRun(0).text());
View Full Code Here

    */
   public void testSprmAIOOB() {
      HWPFDocument doc = HWPFTestDataSamples.openSampleFile("AIOOB-Tap.doc");

      Range r = doc.getRange();
      StyleSheet styleSheet = doc.getStyleSheet();
      for (int x = 0; x < r.numSections(); x++) {
         Section s = r.getSection(x);
         for (int y = 0; y < s.numParagraphs(); y++) {
            Paragraph paragraph = s.getParagraph(y);
            // System.out.println(paragraph.getCharacterRun(0).text());
View Full Code Here

TOP

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

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.