View | Details | Raw Unified | Return to bug 55936
Collapse All | Expand All

(-)src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java (-4 / +7 lines)
Lines 98-105 Link Here
98
   * @param grpprl The original papx.
98
   * @param grpprl The original papx.
99
   * @param offset The current offset in the papx.
99
   * @param offset The current offset in the papx.
100
   * @param spra A part of the sprm that defined this operation.
100
   * @param spra A part of the sprm that defined this operation.
101
   * @throws ClassNotFoundException 
101
   */
102
   */
102
  static void unCompressPAPOperation (ParagraphProperties newPAP, SprmOperation sprm)
103
  static void unCompressPAPOperation (ParagraphProperties newPAP, SprmOperation sprm) throws ClassNotFoundException
103
  {
104
  {
104
    switch (sprm.getOperation())
105
    switch (sprm.getOperation())
105
    {
106
    {
Lines 402-408 Link Here
402
        case 0x4d:
403
        case 0x4d:
403
            // sprmPShd -- 0xc64d
404
            // sprmPShd -- 0xc64d
404
            ShadingDescriptor shadingDescriptor = new ShadingDescriptor(
405
            ShadingDescriptor shadingDescriptor = new ShadingDescriptor(
405
                    sprm.getGrpprl(), 3 );
406
                    sprm.getGrpprl(), sprm.getGrpprlOffset());
406
            newPAP.setShading( shadingDescriptor );
407
            newPAP.setShading( shadingDescriptor );
407
            break;
408
            break;
408
        case 0x5d:
409
        case 0x5d:
Lines 431-443 Link Here
431
        }
432
        }
432
  }
433
  }
433
434
434
  private static void handleTabs(ParagraphProperties pap, SprmOperation sprm)
435
  private static void handleTabs(ParagraphProperties pap, SprmOperation sprm) throws ClassNotFoundException
435
  {
436
  {
436
    byte[] grpprl = sprm.getGrpprl();
437
    byte[] grpprl = sprm.getGrpprl();
437
    int offset = sprm.getGrpprlOffset();
438
    int offset = sprm.getGrpprlOffset();
438
    int delSize = grpprl[offset++];
439
    int delSize = grpprl[offset++];
439
    int[] tabPositions = pap.getRgdxaTab();
440
    int[] tabPositions = pap.getRgdxaTab();
441
    Class.forName("org.apache.poi.hwpf.model.TabDescriptor");
440
    TabDescriptor[] tabDescriptors = pap.getRgtbd();
442
    TabDescriptor[] tabDescriptors = pap.getRgtbd();
443
    //System.out.println("tab : " + tabDescriptors[0]);
441
444
442
    Map<Integer, TabDescriptor> tabMap = new HashMap<Integer, TabDescriptor>();
445
    Map<Integer, TabDescriptor> tabMap = new HashMap<Integer, TabDescriptor>();
443
    for (int x = 0; x < tabPositions.length; x++)
446
    for (int x = 0; x < tabPositions.length; x++)
Lines 456-462 Link Here
456
    for (int x = 0; x < addSize; x++)
459
    for (int x = 0; x < addSize; x++)
457
    {
460
    {
458
      Integer key = Integer.valueOf(LittleEndian.getShort(grpprl, offset));
461
      Integer key = Integer.valueOf(LittleEndian.getShort(grpprl, offset));
459
      TabDescriptor val = new TabDescriptor( grpprl, start + ((TabDescriptor.getSize() * addSize) + x) );
462
      TabDescriptor val = new TabDescriptor( grpprl, start + ((TabDescriptor.getSize() * addSize) + x) + addSize);
460
      tabMap.put(key, val);
463
      tabMap.put(key, val);
461
      offset += LittleEndian.SHORT_SIZE;
464
      offset += LittleEndian.SHORT_SIZE;
462
    }
465
    }

Return to bug 55936