From: Sergey Vladimirov Date: Sat, 16 Jul 2011 10:09:57 +0000 (+0000) Subject: update PAP definition X-Git-Tag: REL_3_8_BETA4~165 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=35046419e22695d6191cdeb0aa0bd500cbed7dc0;p=poi.git update PAP definition git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1147398 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/types/PAPAbstractType.java b/src/scratchpad/src/org/apache/poi/hwpf/model/types/PAPAbstractType.java index a81fd15bc1..176b77efa6 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/types/PAPAbstractType.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/types/PAPAbstractType.java @@ -17,9 +17,6 @@ package org.apache.poi.hwpf.model.types; - - -import org.apache.poi.hdf.model.hdftypes.HDFType; import org.apache.poi.hwpf.usermodel.BorderCode; import org.apache.poi.hwpf.usermodel.DateAndTime; import org.apache.poi.hwpf.usermodel.DropCapSpecifier; @@ -35,363 +32,295 @@ import org.apache.poi.util.BitField; * @author S. Ryan Ackley */ public abstract class PAPAbstractType - implements HDFType { - protected int field_1_istd; - protected byte field_2_fSideBySide; - protected byte field_3_fKeep; - protected byte field_4_fKeepFollow; - protected byte field_5_fPageBreakBefore; - protected byte field_6_brcl; - protected byte field_7_brcp; - protected byte field_8_ilvl; - protected int field_9_ilfo; - protected byte field_10_fNoLnn; - protected LineSpacingDescriptor field_11_lspd; - protected int field_12_dyaBefore; - protected int field_13_dyaAfter; - protected byte field_14_fInTable; - protected byte field_15_finTableW97; - protected byte field_16_fTtp; - protected int field_17_dxaAbs; - protected int field_18_dyaAbs; - protected int field_19_dxaWidth; - protected byte field_20_fBrLnAbove; - protected byte field_21_fBrLnBelow; - protected byte field_22_pcVert; - protected byte field_23_pcHorz; - protected byte field_24_wr; - protected byte field_25_fNoAutoHyph; - protected int field_26_dyaHeight; - protected byte field_27_fMinHeight; - protected DropCapSpecifier field_28_dcs; - protected int field_29_dyaFromText; - protected int field_30_dxaFromText; - protected byte field_31_fLocked; - protected byte field_32_fWidowControl; - protected byte field_33_fKinsoku; - protected byte field_34_fWordWrap; - protected byte field_35_fOverflowPunct; - protected byte field_36_fTopLinePunct; - protected byte field_37_fAutoSpaceDE; - protected byte field_38_fAutoSpaceDN; - protected int field_39_wAlignFont; - protected short field_40_fontAlign; + protected int field_1_istd; + protected boolean field_2_fSideBySide; + protected boolean field_3_fKeep; + protected boolean field_4_fKeepFollow; + protected boolean field_5_fPageBreakBefore; + protected byte field_6_brcl; + /**/public final static byte BRCL_SINGLE = 0; + /**/public final static byte BRCL_THICK = 1; + /**/public final static byte BRCL_DOUBLE = 2; + /**/public final static byte BRCL_SHADOW = 3; + protected byte field_7_brcp; + /**/public final static byte BRCP_NONE = 0; + /**/public final static byte BRCP_BORDER_ABOVE = 1; + /**/public final static byte BRCP_BORDER_BELOW = 2; + /**/public final static byte BRCP_BOX_AROUND = 15; + /**/public final static byte BRCP_BAR_TO_LEFT_OF_PARAGRAPH = 16; + protected byte field_8_ilvl; + protected int field_9_ilfo; + protected boolean field_10_fNoLnn; + protected LineSpacingDescriptor field_11_lspd; + protected int field_12_dyaBefore; + protected int field_13_dyaAfter; + protected boolean field_14_fInTable; + protected boolean field_15_finTableW97; + protected boolean field_16_fTtp; + protected int field_17_dxaAbs; + protected int field_18_dyaAbs; + protected int field_19_dxaWidth; + protected boolean field_20_fBrLnAbove; + protected boolean field_21_fBrLnBelow; + protected byte field_22_pcVert; + protected byte field_23_pcHorz; + protected byte field_24_wr; + protected boolean field_25_fNoAutoHyph; + protected int field_26_dyaHeight; + protected boolean field_27_fMinHeight; + /**/public final static boolean FMINHEIGHT_EXACT = false; + /**/public final static boolean FMINHEIGHT_AT_LEAST = true; + protected DropCapSpecifier field_28_dcs; + protected int field_29_dyaFromText; + protected int field_30_dxaFromText; + protected boolean field_31_fLocked; + protected boolean field_32_fWidowControl; + protected boolean field_33_fKinsoku; + protected boolean field_34_fWordWrap; + protected boolean field_35_fOverflowPunct; + protected boolean field_36_fTopLinePunct; + protected boolean field_37_fAutoSpaceDE; + protected boolean field_38_fAutoSpaceDN; + protected int field_39_wAlignFont; + /**/public final static byte WALIGNFONT_HANGING = 0; + /**/public final static byte WALIGNFONT_CENTERED = 1; + /**/public final static byte WALIGNFONT_ROMAN = 2; + /**/public final static byte WALIGNFONT_VARIABLE = 3; + /**/public final static byte WALIGNFONT_AUTO = 4; + protected short field_40_fontAlign; private static BitField fVertical = new BitField(0x0001); private static BitField fBackward = new BitField(0x0002); private static BitField fRotateFont = new BitField(0x0004); - protected byte field_41_fVertical; - protected byte field_42_fBackward; - protected byte field_43_fRotateFont; - protected byte field_44_lvl; - protected byte field_45_fBiDi; - protected byte field_46_fNumRMIns; - protected byte field_47_fCrLf; - protected byte field_48_fUsePgsuSettings; - protected byte field_49_fAdjustRight; - protected int field_50_itap; - protected byte field_51_fInnerTableCell; - protected byte field_52_fOpenTch; - protected byte field_53_fTtpEmbedded; - protected short field_54_dxcRight; - protected short field_55_dxcLeft; - protected short field_56_dxcLeft1; - protected byte field_57_fDyaBeforeAuto; - protected byte field_58_fDyaAfterAuto; - protected int field_59_dxaRight; - protected int field_60_dxaLeft; - protected int field_61_dxaLeft1; - protected byte field_62_jc; - protected byte field_63_fNoAllowOverlap; - protected BorderCode field_64_brcTop; - protected BorderCode field_65_brcLeft; - protected BorderCode field_66_brcBottom; - protected BorderCode field_67_brcRight; - protected BorderCode field_68_brcBetween; - protected BorderCode field_69_brcBar; - protected ShadingDescriptor field_70_shd; - protected byte[] field_71_anld; - protected byte[] field_72_phe; - protected int field_73_fPropRMark; - protected int field_74_ibstPropRMark; - protected DateAndTime field_75_dttmPropRMark; - protected int field_76_itbdMac; - protected int[] field_77_rgdxaTab; - protected byte[] field_78_rgtbd; - protected byte[] field_79_numrm; - protected byte[] field_80_ptap; - - - public PAPAbstractType() - { - + protected byte field_41_lvl; + protected boolean field_42_fBiDi; + protected boolean field_43_fNumRMIns; + protected boolean field_44_fCrLf; + protected boolean field_45_fUsePgsuSettings; + protected boolean field_46_fAdjustRight; + protected int field_47_itap; + protected boolean field_48_fInnerTableCell; + protected boolean field_49_fOpenTch; + protected boolean field_50_fTtpEmbedded; + protected short field_51_dxcRight; + protected short field_52_dxcLeft; + protected short field_53_dxcLeft1; + protected boolean field_54_fDyaBeforeAuto; + protected boolean field_55_fDyaAfterAuto; + protected int field_56_dxaRight; + protected int field_57_dxaLeft; + protected int field_58_dxaLeft1; + protected byte field_59_jc; + protected boolean field_60_fNoAllowOverlap; + protected BorderCode field_61_brcTop; + protected BorderCode field_62_brcLeft; + protected BorderCode field_63_brcBottom; + protected BorderCode field_64_brcRight; + protected BorderCode field_65_brcBetween; + protected BorderCode field_66_brcBar; + protected ShadingDescriptor field_67_shd; + protected byte[] field_68_anld; + protected byte[] field_69_phe; + protected boolean field_70_fPropRMark; + protected int field_71_ibstPropRMark; + protected DateAndTime field_72_dttmPropRMark; + protected int field_73_itbdMac; + protected int[] field_74_rgdxaTab; + protected byte[] field_75_rgtbd; + protected byte[] field_76_numrm; + protected byte[] field_77_ptap; + + protected PAPAbstractType() + { + this.field_11_lspd = new LineSpacingDescriptor(); + this.field_11_lspd = new LineSpacingDescriptor(); + this.field_28_dcs = new DropCapSpecifier(); + this.field_32_fWidowControl = true; + this.field_41_lvl = 9; + this.field_61_brcTop = new BorderCode(); + this.field_62_brcLeft = new BorderCode(); + this.field_63_brcBottom = new BorderCode(); + this.field_64_brcRight = new BorderCode(); + this.field_65_brcBetween = new BorderCode(); + this.field_66_brcBar = new BorderCode(); + this.field_67_shd = new ShadingDescriptor(); + this.field_68_anld = new byte[0]; + this.field_69_phe = new byte[0]; + this.field_72_dttmPropRMark = new DateAndTime(); + this.field_74_rgdxaTab = new int[0]; + this.field_75_rgtbd = new byte[0]; + this.field_76_numrm = new byte[0]; + this.field_77_ptap = new byte[0]; } public String toString() { - StringBuffer buffer = new StringBuffer(); - - buffer.append("[PAP]\n"); - - buffer.append(" .istd = "); - buffer.append(" (").append(getIstd()).append(" )\n"); - - buffer.append(" .fSideBySide = "); - buffer.append(" (").append(getFSideBySide()).append(" )\n"); - - buffer.append(" .fKeep = "); - buffer.append(" (").append(getFKeep()).append(" )\n"); - - buffer.append(" .fKeepFollow = "); - buffer.append(" (").append(getFKeepFollow()).append(" )\n"); - - buffer.append(" .fPageBreakBefore = "); - buffer.append(" (").append(getFPageBreakBefore()).append(" )\n"); - - buffer.append(" .brcl = "); - buffer.append(" (").append(getBrcl()).append(" )\n"); - - buffer.append(" .brcp = "); - buffer.append(" (").append(getBrcp()).append(" )\n"); - - buffer.append(" .ilvl = "); - buffer.append(" (").append(getIlvl()).append(" )\n"); - - buffer.append(" .ilfo = "); - buffer.append(" (").append(getIlfo()).append(" )\n"); - - buffer.append(" .fNoLnn = "); - buffer.append(" (").append(getFNoLnn()).append(" )\n"); - - buffer.append(" .lspd = "); - buffer.append(" (").append(getLspd()).append(" )\n"); - - buffer.append(" .dyaBefore = "); - buffer.append(" (").append(getDyaBefore()).append(" )\n"); - - buffer.append(" .dyaAfter = "); - buffer.append(" (").append(getDyaAfter()).append(" )\n"); - - buffer.append(" .fInTable = "); - buffer.append(" (").append(getFInTable()).append(" )\n"); - - buffer.append(" .finTableW97 = "); - buffer.append(" (").append(getFinTableW97()).append(" )\n"); - - buffer.append(" .fTtp = "); - buffer.append(" (").append(getFTtp()).append(" )\n"); - - buffer.append(" .dxaAbs = "); - buffer.append(" (").append(getDxaAbs()).append(" )\n"); - - buffer.append(" .dyaAbs = "); - buffer.append(" (").append(getDyaAbs()).append(" )\n"); - - buffer.append(" .dxaWidth = "); - buffer.append(" (").append(getDxaWidth()).append(" )\n"); - - buffer.append(" .fBrLnAbove = "); - buffer.append(" (").append(getFBrLnAbove()).append(" )\n"); - - buffer.append(" .fBrLnBelow = "); - buffer.append(" (").append(getFBrLnBelow()).append(" )\n"); - - buffer.append(" .pcVert = "); - buffer.append(" (").append(getPcVert()).append(" )\n"); - - buffer.append(" .pcHorz = "); - buffer.append(" (").append(getPcHorz()).append(" )\n"); - - buffer.append(" .wr = "); - buffer.append(" (").append(getWr()).append(" )\n"); - - buffer.append(" .fNoAutoHyph = "); - buffer.append(" (").append(getFNoAutoHyph()).append(" )\n"); - - buffer.append(" .dyaHeight = "); - buffer.append(" (").append(getDyaHeight()).append(" )\n"); - - buffer.append(" .fMinHeight = "); - buffer.append(" (").append(getFMinHeight()).append(" )\n"); - - buffer.append(" .dcs = "); - buffer.append(" (").append(getDcs()).append(" )\n"); - - buffer.append(" .dyaFromText = "); - buffer.append(" (").append(getDyaFromText()).append(" )\n"); - - buffer.append(" .dxaFromText = "); - buffer.append(" (").append(getDxaFromText()).append(" )\n"); - - buffer.append(" .fLocked = "); - buffer.append(" (").append(getFLocked()).append(" )\n"); - - buffer.append(" .fWidowControl = "); - buffer.append(" (").append(getFWidowControl()).append(" )\n"); - - buffer.append(" .fKinsoku = "); - buffer.append(" (").append(getFKinsoku()).append(" )\n"); - - buffer.append(" .fWordWrap = "); - buffer.append(" (").append(getFWordWrap()).append(" )\n"); - - buffer.append(" .fOverflowPunct = "); - buffer.append(" (").append(getFOverflowPunct()).append(" )\n"); - - buffer.append(" .fTopLinePunct = "); - buffer.append(" (").append(getFTopLinePunct()).append(" )\n"); - - buffer.append(" .fAutoSpaceDE = "); - buffer.append(" (").append(getFAutoSpaceDE()).append(" )\n"); - - buffer.append(" .fAutoSpaceDN = "); - buffer.append(" (").append(getFAutoSpaceDN()).append(" )\n"); - - buffer.append(" .wAlignFont = "); - buffer.append(" (").append(getWAlignFont()).append(" )\n"); - - buffer.append(" .fontAlign = "); - buffer.append(" (").append(getFontAlign()).append(" )\n"); - buffer.append(" .fVertical = ").append(isFVertical()).append('\n'); - buffer.append(" .fBackward = ").append(isFBackward()).append('\n'); - buffer.append(" .fRotateFont = ").append(isFRotateFont()).append('\n'); - - buffer.append(" .fVertical = "); - buffer.append(" (").append(getFVertical()).append(" )\n"); - - buffer.append(" .fBackward = "); - buffer.append(" (").append(getFBackward()).append(" )\n"); - - buffer.append(" .fRotateFont = "); - buffer.append(" (").append(getFRotateFont()).append(" )\n"); - - buffer.append(" .lvl = "); - buffer.append(" (").append(getLvl()).append(" )\n"); - - buffer.append(" .fBiDi = "); - buffer.append(" (").append(getFBiDi()).append(" )\n"); - - buffer.append(" .fNumRMIns = "); - buffer.append(" (").append(getFNumRMIns()).append(" )\n"); - - buffer.append(" .fCrLf = "); - buffer.append(" (").append(getFCrLf()).append(" )\n"); - - buffer.append(" .fUsePgsuSettings = "); - buffer.append(" (").append(getFUsePgsuSettings()).append(" )\n"); - - buffer.append(" .fAdjustRight = "); - buffer.append(" (").append(getFAdjustRight()).append(" )\n"); - - buffer.append(" .itap = "); - buffer.append(" (").append(getItap()).append(" )\n"); - - buffer.append(" .fInnerTableCell = "); - buffer.append(" (").append(getFInnerTableCell()).append(" )\n"); - - buffer.append(" .fOpenTch = "); - buffer.append(" (").append(getFOpenTch()).append(" )\n"); - - buffer.append(" .fTtpEmbedded = "); - buffer.append(" (").append(getFTtpEmbedded()).append(" )\n"); - - buffer.append(" .dxcRight = "); - buffer.append(" (").append(getDxcRight()).append(" )\n"); - - buffer.append(" .dxcLeft = "); - buffer.append(" (").append(getDxcLeft()).append(" )\n"); - - buffer.append(" .dxcLeft1 = "); - buffer.append(" (").append(getDxcLeft1()).append(" )\n"); - - buffer.append(" .fDyaBeforeAuto = "); - buffer.append(" (").append(getFDyaBeforeAuto()).append(" )\n"); - - buffer.append(" .fDyaAfterAuto = "); - buffer.append(" (").append(getFDyaAfterAuto()).append(" )\n"); - - buffer.append(" .dxaRight = "); - buffer.append(" (").append(getDxaRight()).append(" )\n"); - - buffer.append(" .dxaLeft = "); - buffer.append(" (").append(getDxaLeft()).append(" )\n"); - - buffer.append(" .dxaLeft1 = "); - buffer.append(" (").append(getDxaLeft1()).append(" )\n"); - - buffer.append(" .jc = "); - buffer.append(" (").append(getJc()).append(" )\n"); - - buffer.append(" .fNoAllowOverlap = "); - buffer.append(" (").append(getFNoAllowOverlap()).append(" )\n"); - - buffer.append(" .brcTop = "); - buffer.append(" (").append(getBrcTop()).append(" )\n"); - - buffer.append(" .brcLeft = "); - buffer.append(" (").append(getBrcLeft()).append(" )\n"); - - buffer.append(" .brcBottom = "); - buffer.append(" (").append(getBrcBottom()).append(" )\n"); - - buffer.append(" .brcRight = "); - buffer.append(" (").append(getBrcRight()).append(" )\n"); - - buffer.append(" .brcBetween = "); - buffer.append(" (").append(getBrcBetween()).append(" )\n"); - - buffer.append(" .brcBar = "); - buffer.append(" (").append(getBrcBar()).append(" )\n"); - - buffer.append(" .shd = "); - buffer.append(" (").append(getShd()).append(" )\n"); - - buffer.append(" .anld = "); - buffer.append(" (").append(getAnld()).append(" )\n"); - - buffer.append(" .phe = "); - buffer.append(" (").append(getPhe()).append(" )\n"); - - buffer.append(" .fPropRMark = "); - buffer.append(" (").append(getFPropRMark()).append(" )\n"); - - buffer.append(" .ibstPropRMark = "); - buffer.append(" (").append(getIbstPropRMark()).append(" )\n"); - - buffer.append(" .dttmPropRMark = "); - buffer.append(" (").append(getDttmPropRMark()).append(" )\n"); - - buffer.append(" .itbdMac = "); - buffer.append(" (").append(getItbdMac()).append(" )\n"); - - buffer.append(" .rgdxaTab = "); - buffer.append(" (").append(getRgdxaTab()).append(" )\n"); - - buffer.append(" .rgtbd = "); - buffer.append(" (").append(getRgtbd()).append(" )\n"); - - buffer.append(" .numrm = "); - buffer.append(" (").append(getNumrm()).append(" )\n"); - - buffer.append(" .ptap = "); - buffer.append(" (").append(getPtap()).append(" )\n"); - - buffer.append("[/PAP]\n"); - return buffer.toString(); - } - - /** - * Size of record (exluding 4 byte header) - */ - public int getSize() - { - return 4 + + 2 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 2 + 1 + 4 + 4 + 4 + 1 + 1 + 1 + 4 + 4 + 4 + 1 + 1 + 1 + 1 + 1 + 1 + 2 + 1 + 2 + 4 + 4 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 2 + 2 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 4 + 1 + 1 + 1 + 2 + 2 + 2 + 1 + 1 + 4 + 4 + 4 + 1 + 1 + 4 + 4 + 4 + 4 + 4 + 4 + 2 + 84 + 12 + 1 + 2 + 4 + 2 + 128 + 128 + 128 + 4; + StringBuilder builder = new StringBuilder(); + builder.append("[PAP]\n"); + builder.append(" .istd = "); + builder.append(" (").append(getIstd()).append(" )\n"); + builder.append(" .fSideBySide = "); + builder.append(" (").append(getFSideBySide()).append(" )\n"); + builder.append(" .fKeep = "); + builder.append(" (").append(getFKeep()).append(" )\n"); + builder.append(" .fKeepFollow = "); + builder.append(" (").append(getFKeepFollow()).append(" )\n"); + builder.append(" .fPageBreakBefore = "); + builder.append(" (").append(getFPageBreakBefore()).append(" )\n"); + builder.append(" .brcl = "); + builder.append(" (").append(getBrcl()).append(" )\n"); + builder.append(" .brcp = "); + builder.append(" (").append(getBrcp()).append(" )\n"); + builder.append(" .ilvl = "); + builder.append(" (").append(getIlvl()).append(" )\n"); + builder.append(" .ilfo = "); + builder.append(" (").append(getIlfo()).append(" )\n"); + builder.append(" .fNoLnn = "); + builder.append(" (").append(getFNoLnn()).append(" )\n"); + builder.append(" .lspd = "); + builder.append(" (").append(getLspd()).append(" )\n"); + builder.append(" .dyaBefore = "); + builder.append(" (").append(getDyaBefore()).append(" )\n"); + builder.append(" .dyaAfter = "); + builder.append(" (").append(getDyaAfter()).append(" )\n"); + builder.append(" .fInTable = "); + builder.append(" (").append(getFInTable()).append(" )\n"); + builder.append(" .finTableW97 = "); + builder.append(" (").append(getFinTableW97()).append(" )\n"); + builder.append(" .fTtp = "); + builder.append(" (").append(getFTtp()).append(" )\n"); + builder.append(" .dxaAbs = "); + builder.append(" (").append(getDxaAbs()).append(" )\n"); + builder.append(" .dyaAbs = "); + builder.append(" (").append(getDyaAbs()).append(" )\n"); + builder.append(" .dxaWidth = "); + builder.append(" (").append(getDxaWidth()).append(" )\n"); + builder.append(" .fBrLnAbove = "); + builder.append(" (").append(getFBrLnAbove()).append(" )\n"); + builder.append(" .fBrLnBelow = "); + builder.append(" (").append(getFBrLnBelow()).append(" )\n"); + builder.append(" .pcVert = "); + builder.append(" (").append(getPcVert()).append(" )\n"); + builder.append(" .pcHorz = "); + builder.append(" (").append(getPcHorz()).append(" )\n"); + builder.append(" .wr = "); + builder.append(" (").append(getWr()).append(" )\n"); + builder.append(" .fNoAutoHyph = "); + builder.append(" (").append(getFNoAutoHyph()).append(" )\n"); + builder.append(" .dyaHeight = "); + builder.append(" (").append(getDyaHeight()).append(" )\n"); + builder.append(" .fMinHeight = "); + builder.append(" (").append(getFMinHeight()).append(" )\n"); + builder.append(" .dcs = "); + builder.append(" (").append(getDcs()).append(" )\n"); + builder.append(" .dyaFromText = "); + builder.append(" (").append(getDyaFromText()).append(" )\n"); + builder.append(" .dxaFromText = "); + builder.append(" (").append(getDxaFromText()).append(" )\n"); + builder.append(" .fLocked = "); + builder.append(" (").append(getFLocked()).append(" )\n"); + builder.append(" .fWidowControl = "); + builder.append(" (").append(getFWidowControl()).append(" )\n"); + builder.append(" .fKinsoku = "); + builder.append(" (").append(getFKinsoku()).append(" )\n"); + builder.append(" .fWordWrap = "); + builder.append(" (").append(getFWordWrap()).append(" )\n"); + builder.append(" .fOverflowPunct = "); + builder.append(" (").append(getFOverflowPunct()).append(" )\n"); + builder.append(" .fTopLinePunct = "); + builder.append(" (").append(getFTopLinePunct()).append(" )\n"); + builder.append(" .fAutoSpaceDE = "); + builder.append(" (").append(getFAutoSpaceDE()).append(" )\n"); + builder.append(" .fAutoSpaceDN = "); + builder.append(" (").append(getFAutoSpaceDN()).append(" )\n"); + builder.append(" .wAlignFont = "); + builder.append(" (").append(getWAlignFont()).append(" )\n"); + builder.append(" .fontAlign = "); + builder.append(" (").append(getFontAlign()).append(" )\n"); + builder.append(" .fVertical = ").append(isFVertical()).append('\n'); + builder.append(" .fBackward = ").append(isFBackward()).append('\n'); + builder.append(" .fRotateFont = ").append(isFRotateFont()).append('\n'); + builder.append(" .lvl = "); + builder.append(" (").append(getLvl()).append(" )\n"); + builder.append(" .fBiDi = "); + builder.append(" (").append(getFBiDi()).append(" )\n"); + builder.append(" .fNumRMIns = "); + builder.append(" (").append(getFNumRMIns()).append(" )\n"); + builder.append(" .fCrLf = "); + builder.append(" (").append(getFCrLf()).append(" )\n"); + builder.append(" .fUsePgsuSettings = "); + builder.append(" (").append(getFUsePgsuSettings()).append(" )\n"); + builder.append(" .fAdjustRight = "); + builder.append(" (").append(getFAdjustRight()).append(" )\n"); + builder.append(" .itap = "); + builder.append(" (").append(getItap()).append(" )\n"); + builder.append(" .fInnerTableCell = "); + builder.append(" (").append(getFInnerTableCell()).append(" )\n"); + builder.append(" .fOpenTch = "); + builder.append(" (").append(getFOpenTch()).append(" )\n"); + builder.append(" .fTtpEmbedded = "); + builder.append(" (").append(getFTtpEmbedded()).append(" )\n"); + builder.append(" .dxcRight = "); + builder.append(" (").append(getDxcRight()).append(" )\n"); + builder.append(" .dxcLeft = "); + builder.append(" (").append(getDxcLeft()).append(" )\n"); + builder.append(" .dxcLeft1 = "); + builder.append(" (").append(getDxcLeft1()).append(" )\n"); + builder.append(" .fDyaBeforeAuto = "); + builder.append(" (").append(getFDyaBeforeAuto()).append(" )\n"); + builder.append(" .fDyaAfterAuto = "); + builder.append(" (").append(getFDyaAfterAuto()).append(" )\n"); + builder.append(" .dxaRight = "); + builder.append(" (").append(getDxaRight()).append(" )\n"); + builder.append(" .dxaLeft = "); + builder.append(" (").append(getDxaLeft()).append(" )\n"); + builder.append(" .dxaLeft1 = "); + builder.append(" (").append(getDxaLeft1()).append(" )\n"); + builder.append(" .jc = "); + builder.append(" (").append(getJc()).append(" )\n"); + builder.append(" .fNoAllowOverlap = "); + builder.append(" (").append(getFNoAllowOverlap()).append(" )\n"); + builder.append(" .brcTop = "); + builder.append(" (").append(getBrcTop()).append(" )\n"); + builder.append(" .brcLeft = "); + builder.append(" (").append(getBrcLeft()).append(" )\n"); + builder.append(" .brcBottom = "); + builder.append(" (").append(getBrcBottom()).append(" )\n"); + builder.append(" .brcRight = "); + builder.append(" (").append(getBrcRight()).append(" )\n"); + builder.append(" .brcBetween = "); + builder.append(" (").append(getBrcBetween()).append(" )\n"); + builder.append(" .brcBar = "); + builder.append(" (").append(getBrcBar()).append(" )\n"); + builder.append(" .shd = "); + builder.append(" (").append(getShd()).append(" )\n"); + builder.append(" .anld = "); + builder.append(" (").append(getAnld()).append(" )\n"); + builder.append(" .phe = "); + builder.append(" (").append(getPhe()).append(" )\n"); + builder.append(" .fPropRMark = "); + builder.append(" (").append(getFPropRMark()).append(" )\n"); + builder.append(" .ibstPropRMark = "); + builder.append(" (").append(getIbstPropRMark()).append(" )\n"); + builder.append(" .dttmPropRMark = "); + builder.append(" (").append(getDttmPropRMark()).append(" )\n"); + builder.append(" .itbdMac = "); + builder.append(" (").append(getItbdMac()).append(" )\n"); + builder.append(" .rgdxaTab = "); + builder.append(" (").append(getRgdxaTab()).append(" )\n"); + builder.append(" .rgtbd = "); + builder.append(" (").append(getRgtbd()).append(" )\n"); + builder.append(" .numrm = "); + builder.append(" (").append(getNumrm()).append(" )\n"); + builder.append(" .ptap = "); + builder.append(" (").append(getPtap()).append(" )\n"); + + builder.append("[/PAP]\n"); + return builder.toString(); } - - /** * Index to style descriptor. */ @@ -411,7 +340,7 @@ public abstract class PAPAbstractType /** * Get the fSideBySide field for the PAP record. */ - public byte getFSideBySide() + public boolean getFSideBySide() { return field_2_fSideBySide; } @@ -419,7 +348,7 @@ public abstract class PAPAbstractType /** * Set the fSideBySide field for the PAP record. */ - public void setFSideBySide(byte field_2_fSideBySide) + public void setFSideBySide(boolean field_2_fSideBySide) { this.field_2_fSideBySide = field_2_fSideBySide; } @@ -427,7 +356,7 @@ public abstract class PAPAbstractType /** * Get the fKeep field for the PAP record. */ - public byte getFKeep() + public boolean getFKeep() { return field_3_fKeep; } @@ -435,7 +364,7 @@ public abstract class PAPAbstractType /** * Set the fKeep field for the PAP record. */ - public void setFKeep(byte field_3_fKeep) + public void setFKeep(boolean field_3_fKeep) { this.field_3_fKeep = field_3_fKeep; } @@ -443,7 +372,7 @@ public abstract class PAPAbstractType /** * Get the fKeepFollow field for the PAP record. */ - public byte getFKeepFollow() + public boolean getFKeepFollow() { return field_4_fKeepFollow; } @@ -451,7 +380,7 @@ public abstract class PAPAbstractType /** * Set the fKeepFollow field for the PAP record. */ - public void setFKeepFollow(byte field_4_fKeepFollow) + public void setFKeepFollow(boolean field_4_fKeepFollow) { this.field_4_fKeepFollow = field_4_fKeepFollow; } @@ -459,7 +388,7 @@ public abstract class PAPAbstractType /** * Get the fPageBreakBefore field for the PAP record. */ - public byte getFPageBreakBefore() + public boolean getFPageBreakBefore() { return field_5_fPageBreakBefore; } @@ -467,13 +396,19 @@ public abstract class PAPAbstractType /** * Set the fPageBreakBefore field for the PAP record. */ - public void setFPageBreakBefore(byte field_5_fPageBreakBefore) + public void setFPageBreakBefore(boolean field_5_fPageBreakBefore) { this.field_5_fPageBreakBefore = field_5_fPageBreakBefore; } /** * Border line style. + * + * @return One of + *
  • {@link #BRCL_SINGLE} + *
  • {@link #BRCL_THICK} + *
  • {@link #BRCL_DOUBLE} + *
  • {@link #BRCL_SHADOW} */ public byte getBrcl() { @@ -482,6 +417,13 @@ public abstract class PAPAbstractType /** * Border line style. + * + * @param field_6_brcl + * One of + *
  • {@link #BRCL_SINGLE} + *
  • {@link #BRCL_THICK} + *
  • {@link #BRCL_DOUBLE} + *
  • {@link #BRCL_SHADOW} */ public void setBrcl(byte field_6_brcl) { @@ -490,6 +432,13 @@ public abstract class PAPAbstractType /** * Rectangle border codes. + * + * @return One of + *
  • {@link #BRCP_NONE} + *
  • {@link #BRCP_BORDER_ABOVE} + *
  • {@link #BRCP_BORDER_BELOW} + *
  • {@link #BRCP_BOX_AROUND} + *
  • {@link #BRCP_BAR_TO_LEFT_OF_PARAGRAPH} */ public byte getBrcp() { @@ -498,6 +447,14 @@ public abstract class PAPAbstractType /** * Rectangle border codes. + * + * @param field_7_brcp + * One of + *
  • {@link #BRCP_NONE} + *
  • {@link #BRCP_BORDER_ABOVE} + *
  • {@link #BRCP_BORDER_BELOW} + *
  • {@link #BRCP_BOX_AROUND} + *
  • {@link #BRCP_BAR_TO_LEFT_OF_PARAGRAPH} */ public void setBrcp(byte field_7_brcp) { @@ -539,7 +496,7 @@ public abstract class PAPAbstractType /** * No line numbering. */ - public byte getFNoLnn() + public boolean getFNoLnn() { return field_10_fNoLnn; } @@ -547,7 +504,7 @@ public abstract class PAPAbstractType /** * No line numbering. */ - public void setFNoLnn(byte field_10_fNoLnn) + public void setFNoLnn(boolean field_10_fNoLnn) { this.field_10_fNoLnn = field_10_fNoLnn; } @@ -603,7 +560,7 @@ public abstract class PAPAbstractType /** * Paragraph is in table flag. */ - public byte getFInTable() + public boolean getFInTable() { return field_14_fInTable; } @@ -611,7 +568,7 @@ public abstract class PAPAbstractType /** * Paragraph is in table flag. */ - public void setFInTable(byte field_14_fInTable) + public void setFInTable(boolean field_14_fInTable) { this.field_14_fInTable = field_14_fInTable; } @@ -619,7 +576,7 @@ public abstract class PAPAbstractType /** * Archaic paragraph is in table flag. */ - public byte getFinTableW97() + public boolean getFinTableW97() { return field_15_finTableW97; } @@ -627,7 +584,7 @@ public abstract class PAPAbstractType /** * Archaic paragraph is in table flag. */ - public void setFinTableW97(byte field_15_finTableW97) + public void setFinTableW97(boolean field_15_finTableW97) { this.field_15_finTableW97 = field_15_finTableW97; } @@ -635,7 +592,7 @@ public abstract class PAPAbstractType /** * Table trailer paragraph (last in table row). */ - public byte getFTtp() + public boolean getFTtp() { return field_16_fTtp; } @@ -643,7 +600,7 @@ public abstract class PAPAbstractType /** * Table trailer paragraph (last in table row). */ - public void setFTtp(byte field_16_fTtp) + public void setFTtp(boolean field_16_fTtp) { this.field_16_fTtp = field_16_fTtp; } @@ -699,7 +656,7 @@ public abstract class PAPAbstractType /** * Get the fBrLnAbove field for the PAP record. */ - public byte getFBrLnAbove() + public boolean getFBrLnAbove() { return field_20_fBrLnAbove; } @@ -707,7 +664,7 @@ public abstract class PAPAbstractType /** * Set the fBrLnAbove field for the PAP record. */ - public void setFBrLnAbove(byte field_20_fBrLnAbove) + public void setFBrLnAbove(boolean field_20_fBrLnAbove) { this.field_20_fBrLnAbove = field_20_fBrLnAbove; } @@ -715,7 +672,7 @@ public abstract class PAPAbstractType /** * Get the fBrLnBelow field for the PAP record. */ - public byte getFBrLnBelow() + public boolean getFBrLnBelow() { return field_21_fBrLnBelow; } @@ -723,7 +680,7 @@ public abstract class PAPAbstractType /** * Set the fBrLnBelow field for the PAP record. */ - public void setFBrLnBelow(byte field_21_fBrLnBelow) + public void setFBrLnBelow(boolean field_21_fBrLnBelow) { this.field_21_fBrLnBelow = field_21_fBrLnBelow; } @@ -779,7 +736,7 @@ public abstract class PAPAbstractType /** * Get the fNoAutoHyph field for the PAP record. */ - public byte getFNoAutoHyph() + public boolean getFNoAutoHyph() { return field_25_fNoAutoHyph; } @@ -787,7 +744,7 @@ public abstract class PAPAbstractType /** * Set the fNoAutoHyph field for the PAP record. */ - public void setFNoAutoHyph(byte field_25_fNoAutoHyph) + public void setFNoAutoHyph(boolean field_25_fNoAutoHyph) { this.field_25_fNoAutoHyph = field_25_fNoAutoHyph; } @@ -809,17 +766,26 @@ public abstract class PAPAbstractType } /** - * Get the fMinHeight field for the PAP record. + * Minimum height is exact or auto. + * + * @return One of + *
  • {@link #FMINHEIGHT_EXACT} + *
  • {@link #FMINHEIGHT_AT_LEAST} */ - public byte getFMinHeight() + public boolean getFMinHeight() { return field_27_fMinHeight; } /** - * Set the fMinHeight field for the PAP record. + * Minimum height is exact or auto. + * + * @param field_27_fMinHeight + * One of + *
  • {@link #FMINHEIGHT_EXACT} + *
  • {@link #FMINHEIGHT_AT_LEAST} */ - public void setFMinHeight(byte field_27_fMinHeight) + public void setFMinHeight(boolean field_27_fMinHeight) { this.field_27_fMinHeight = field_27_fMinHeight; } @@ -873,135 +839,142 @@ public abstract class PAPAbstractType } /** - * Get the fLocked field for the PAP record. + * Anchor of an absolutely positioned frame is locked. */ - public byte getFLocked() + public boolean getFLocked() { return field_31_fLocked; } /** - * Set the fLocked field for the PAP record. + * Anchor of an absolutely positioned frame is locked. */ - public void setFLocked(byte field_31_fLocked) + public void setFLocked(boolean field_31_fLocked) { this.field_31_fLocked = field_31_fLocked; } /** - * Get the fWidowControl field for the PAP record. + * 1, Word will prevent widowed lines in this paragraph from being placed at the beginning of a page. */ - public byte getFWidowControl() + public boolean getFWidowControl() { return field_32_fWidowControl; } /** - * Set the fWidowControl field for the PAP record. + * 1, Word will prevent widowed lines in this paragraph from being placed at the beginning of a page. */ - public void setFWidowControl(byte field_32_fWidowControl) + public void setFWidowControl(boolean field_32_fWidowControl) { this.field_32_fWidowControl = field_32_fWidowControl; } /** - * Get the fKinsoku field for the PAP record. + * apply Kinsoku rules when performing line wrapping. */ - public byte getFKinsoku() + public boolean getFKinsoku() { return field_33_fKinsoku; } /** - * Set the fKinsoku field for the PAP record. + * apply Kinsoku rules when performing line wrapping. */ - public void setFKinsoku(byte field_33_fKinsoku) + public void setFKinsoku(boolean field_33_fKinsoku) { this.field_33_fKinsoku = field_33_fKinsoku; } /** - * Get the fWordWrap field for the PAP record. + * perform word wrap. */ - public byte getFWordWrap() + public boolean getFWordWrap() { return field_34_fWordWrap; } /** - * Set the fWordWrap field for the PAP record. + * perform word wrap. */ - public void setFWordWrap(byte field_34_fWordWrap) + public void setFWordWrap(boolean field_34_fWordWrap) { this.field_34_fWordWrap = field_34_fWordWrap; } /** - * Get the fOverflowPunct field for the PAP record. + * apply overflow punctuation rules when performing line wrapping. */ - public byte getFOverflowPunct() + public boolean getFOverflowPunct() { return field_35_fOverflowPunct; } /** - * Set the fOverflowPunct field for the PAP record. + * apply overflow punctuation rules when performing line wrapping. */ - public void setFOverflowPunct(byte field_35_fOverflowPunct) + public void setFOverflowPunct(boolean field_35_fOverflowPunct) { this.field_35_fOverflowPunct = field_35_fOverflowPunct; } /** - * Get the fTopLinePunct field for the PAP record. + * perform top line punctuation processing. */ - public byte getFTopLinePunct() + public boolean getFTopLinePunct() { return field_36_fTopLinePunct; } /** - * Set the fTopLinePunct field for the PAP record. + * perform top line punctuation processing. */ - public void setFTopLinePunct(byte field_36_fTopLinePunct) + public void setFTopLinePunct(boolean field_36_fTopLinePunct) { this.field_36_fTopLinePunct = field_36_fTopLinePunct; } /** - * Get the fAutoSpaceDE field for the PAP record. + * auto space East Asian and alphabetic characters. */ - public byte getFAutoSpaceDE() + public boolean getFAutoSpaceDE() { return field_37_fAutoSpaceDE; } /** - * Set the fAutoSpaceDE field for the PAP record. + * auto space East Asian and alphabetic characters. */ - public void setFAutoSpaceDE(byte field_37_fAutoSpaceDE) + public void setFAutoSpaceDE(boolean field_37_fAutoSpaceDE) { this.field_37_fAutoSpaceDE = field_37_fAutoSpaceDE; } /** - * Get the fAutoSpaceDN field for the PAP record. + * auto space East Asian and numeric characters. */ - public byte getFAutoSpaceDN() + public boolean getFAutoSpaceDN() { return field_38_fAutoSpaceDN; } /** - * Set the fAutoSpaceDN field for the PAP record. + * auto space East Asian and numeric characters. */ - public void setFAutoSpaceDN(byte field_38_fAutoSpaceDN) + public void setFAutoSpaceDN(boolean field_38_fAutoSpaceDN) { this.field_38_fAutoSpaceDN = field_38_fAutoSpaceDN; } /** * Get the wAlignFont field for the PAP record. + * + * @return One of + *
  • {@link #WALIGNFONT_HANGING} + *
  • {@link #WALIGNFONT_CENTERED} + *
  • {@link #WALIGNFONT_ROMAN} + *
  • {@link #WALIGNFONT_VARIABLE} + *
  • {@link #WALIGNFONT_AUTO} */ public int getWAlignFont() { @@ -1010,6 +983,14 @@ public abstract class PAPAbstractType /** * Set the wAlignFont field for the PAP record. + * + * @param field_39_wAlignFont + * One of + *
  • {@link #WALIGNFONT_HANGING} + *
  • {@link #WALIGNFONT_CENTERED} + *
  • {@link #WALIGNFONT_ROMAN} + *
  • {@link #WALIGNFONT_VARIABLE} + *
  • {@link #WALIGNFONT_AUTO} */ public void setWAlignFont(int field_39_wAlignFont) { @@ -1017,7 +998,7 @@ public abstract class PAPAbstractType } /** - * Get the fontAlign field for the PAP record. + * Used internally by Word. */ public short getFontAlign() { @@ -1025,7 +1006,7 @@ public abstract class PAPAbstractType } /** - * Set the fontAlign field for the PAP record. + * Used internally by Word. */ public void setFontAlign(short field_40_fontAlign) { @@ -1033,147 +1014,99 @@ public abstract class PAPAbstractType } /** - * Get the fVertical field for the PAP record. - */ - public byte getFVertical() - { - return field_41_fVertical; - } - - /** - * Set the fVertical field for the PAP record. - */ - public void setFVertical(byte field_41_fVertical) - { - this.field_41_fVertical = field_41_fVertical; - } - - /** - * Get the fBackward field for the PAP record. - */ - public byte getFBackward() - { - return field_42_fBackward; - } - - /** - * Set the fBackward field for the PAP record. - */ - public void setFBackward(byte field_42_fBackward) - { - this.field_42_fBackward = field_42_fBackward; - } - - /** - * Get the fRotateFont field for the PAP record. - */ - public byte getFRotateFont() - { - return field_43_fRotateFont; - } - - /** - * Set the fRotateFont field for the PAP record. - */ - public void setFRotateFont(byte field_43_fRotateFont) - { - this.field_43_fRotateFont = field_43_fRotateFont; - } - - /** - * Get the lvl field for the PAP record. + * Outline level. */ public byte getLvl() { - return field_44_lvl; + return field_41_lvl; } /** - * Set the lvl field for the PAP record. + * Outline level. */ - public void setLvl(byte field_44_lvl) + public void setLvl(byte field_41_lvl) { - this.field_44_lvl = field_44_lvl; + this.field_41_lvl = field_41_lvl; } /** * Get the fBiDi field for the PAP record. */ - public byte getFBiDi() + public boolean getFBiDi() { - return field_45_fBiDi; + return field_42_fBiDi; } /** * Set the fBiDi field for the PAP record. */ - public void setFBiDi(byte field_45_fBiDi) + public void setFBiDi(boolean field_42_fBiDi) { - this.field_45_fBiDi = field_45_fBiDi; + this.field_42_fBiDi = field_42_fBiDi; } /** * Get the fNumRMIns field for the PAP record. */ - public byte getFNumRMIns() + public boolean getFNumRMIns() { - return field_46_fNumRMIns; + return field_43_fNumRMIns; } /** * Set the fNumRMIns field for the PAP record. */ - public void setFNumRMIns(byte field_46_fNumRMIns) + public void setFNumRMIns(boolean field_43_fNumRMIns) { - this.field_46_fNumRMIns = field_46_fNumRMIns; + this.field_43_fNumRMIns = field_43_fNumRMIns; } /** * Get the fCrLf field for the PAP record. */ - public byte getFCrLf() + public boolean getFCrLf() { - return field_47_fCrLf; + return field_44_fCrLf; } /** * Set the fCrLf field for the PAP record. */ - public void setFCrLf(byte field_47_fCrLf) + public void setFCrLf(boolean field_44_fCrLf) { - this.field_47_fCrLf = field_47_fCrLf; + this.field_44_fCrLf = field_44_fCrLf; } /** * Get the fUsePgsuSettings field for the PAP record. */ - public byte getFUsePgsuSettings() + public boolean getFUsePgsuSettings() { - return field_48_fUsePgsuSettings; + return field_45_fUsePgsuSettings; } /** * Set the fUsePgsuSettings field for the PAP record. */ - public void setFUsePgsuSettings(byte field_48_fUsePgsuSettings) + public void setFUsePgsuSettings(boolean field_45_fUsePgsuSettings) { - this.field_48_fUsePgsuSettings = field_48_fUsePgsuSettings; + this.field_45_fUsePgsuSettings = field_45_fUsePgsuSettings; } /** * Get the fAdjustRight field for the PAP record. */ - public byte getFAdjustRight() + public boolean getFAdjustRight() { - return field_49_fAdjustRight; + return field_46_fAdjustRight; } /** * Set the fAdjustRight field for the PAP record. */ - public void setFAdjustRight(byte field_49_fAdjustRight) + public void setFAdjustRight(boolean field_46_fAdjustRight) { - this.field_49_fAdjustRight = field_49_fAdjustRight; + this.field_46_fAdjustRight = field_46_fAdjustRight; } /** @@ -1181,63 +1114,63 @@ public abstract class PAPAbstractType */ public int getItap() { - return field_50_itap; + return field_47_itap; } /** * Table nesting level. */ - public void setItap(int field_50_itap) + public void setItap(int field_47_itap) { - this.field_50_itap = field_50_itap; + this.field_47_itap = field_47_itap; } /** * When 1, the end of paragraph mark is really an end of cell mark for a nested table cell. */ - public byte getFInnerTableCell() + public boolean getFInnerTableCell() { - return field_51_fInnerTableCell; + return field_48_fInnerTableCell; } /** * When 1, the end of paragraph mark is really an end of cell mark for a nested table cell. */ - public void setFInnerTableCell(byte field_51_fInnerTableCell) + public void setFInnerTableCell(boolean field_48_fInnerTableCell) { - this.field_51_fInnerTableCell = field_51_fInnerTableCell; + this.field_48_fInnerTableCell = field_48_fInnerTableCell; } /** * Ensure the Table Cell char doesn't show up as zero height. */ - public byte getFOpenTch() + public boolean getFOpenTch() { - return field_52_fOpenTch; + return field_49_fOpenTch; } /** * Ensure the Table Cell char doesn't show up as zero height. */ - public void setFOpenTch(byte field_52_fOpenTch) + public void setFOpenTch(boolean field_49_fOpenTch) { - this.field_52_fOpenTch = field_52_fOpenTch; + this.field_49_fOpenTch = field_49_fOpenTch; } /** * Word 97 compatibility indicates this end of paragraph mark is really an end of row marker for a nested table. */ - public byte getFTtpEmbedded() + public boolean getFTtpEmbedded() { - return field_53_fTtpEmbedded; + return field_50_fTtpEmbedded; } /** * Word 97 compatibility indicates this end of paragraph mark is really an end of row marker for a nested table. */ - public void setFTtpEmbedded(byte field_53_fTtpEmbedded) + public void setFTtpEmbedded(boolean field_50_fTtpEmbedded) { - this.field_53_fTtpEmbedded = field_53_fTtpEmbedded; + this.field_50_fTtpEmbedded = field_50_fTtpEmbedded; } /** @@ -1245,15 +1178,15 @@ public abstract class PAPAbstractType */ public short getDxcRight() { - return field_54_dxcRight; + return field_51_dxcRight; } /** * Right indent in character units. */ - public void setDxcRight(short field_54_dxcRight) + public void setDxcRight(short field_51_dxcRight) { - this.field_54_dxcRight = field_54_dxcRight; + this.field_51_dxcRight = field_51_dxcRight; } /** @@ -1261,15 +1194,15 @@ public abstract class PAPAbstractType */ public short getDxcLeft() { - return field_55_dxcLeft; + return field_52_dxcLeft; } /** * Left indent in character units. */ - public void setDxcLeft(short field_55_dxcLeft) + public void setDxcLeft(short field_52_dxcLeft) { - this.field_55_dxcLeft = field_55_dxcLeft; + this.field_52_dxcLeft = field_52_dxcLeft; } /** @@ -1277,47 +1210,47 @@ public abstract class PAPAbstractType */ public short getDxcLeft1() { - return field_56_dxcLeft1; + return field_53_dxcLeft1; } /** * First line indent in character units. */ - public void setDxcLeft1(short field_56_dxcLeft1) + public void setDxcLeft1(short field_53_dxcLeft1) { - this.field_56_dxcLeft1 = field_56_dxcLeft1; + this.field_53_dxcLeft1 = field_53_dxcLeft1; } /** * Vertical spacing before is automatic. */ - public byte getFDyaBeforeAuto() + public boolean getFDyaBeforeAuto() { - return field_57_fDyaBeforeAuto; + return field_54_fDyaBeforeAuto; } /** * Vertical spacing before is automatic. */ - public void setFDyaBeforeAuto(byte field_57_fDyaBeforeAuto) + public void setFDyaBeforeAuto(boolean field_54_fDyaBeforeAuto) { - this.field_57_fDyaBeforeAuto = field_57_fDyaBeforeAuto; + this.field_54_fDyaBeforeAuto = field_54_fDyaBeforeAuto; } /** * Vertical spacing after is automatic. */ - public byte getFDyaAfterAuto() + public boolean getFDyaAfterAuto() { - return field_58_fDyaAfterAuto; + return field_55_fDyaAfterAuto; } /** * Vertical spacing after is automatic. */ - public void setFDyaAfterAuto(byte field_58_fDyaAfterAuto) + public void setFDyaAfterAuto(boolean field_55_fDyaAfterAuto) { - this.field_58_fDyaAfterAuto = field_58_fDyaAfterAuto; + this.field_55_fDyaAfterAuto = field_55_fDyaAfterAuto; } /** @@ -1325,15 +1258,15 @@ public abstract class PAPAbstractType */ public int getDxaRight() { - return field_59_dxaRight; + return field_56_dxaRight; } /** * Set the dxaRight field for the PAP record. */ - public void setDxaRight(int field_59_dxaRight) + public void setDxaRight(int field_56_dxaRight) { - this.field_59_dxaRight = field_59_dxaRight; + this.field_56_dxaRight = field_56_dxaRight; } /** @@ -1341,15 +1274,15 @@ public abstract class PAPAbstractType */ public int getDxaLeft() { - return field_60_dxaLeft; + return field_57_dxaLeft; } /** * Set the dxaLeft field for the PAP record. */ - public void setDxaLeft(int field_60_dxaLeft) + public void setDxaLeft(int field_57_dxaLeft) { - this.field_60_dxaLeft = field_60_dxaLeft; + this.field_57_dxaLeft = field_57_dxaLeft; } /** @@ -1357,15 +1290,15 @@ public abstract class PAPAbstractType */ public int getDxaLeft1() { - return field_61_dxaLeft1; + return field_58_dxaLeft1; } /** * Set the dxaLeft1 field for the PAP record. */ - public void setDxaLeft1(int field_61_dxaLeft1) + public void setDxaLeft1(int field_58_dxaLeft1) { - this.field_61_dxaLeft1 = field_61_dxaLeft1; + this.field_58_dxaLeft1 = field_58_dxaLeft1; } /** @@ -1373,31 +1306,31 @@ public abstract class PAPAbstractType */ public byte getJc() { - return field_62_jc; + return field_59_jc; } /** * Set the jc field for the PAP record. */ - public void setJc(byte field_62_jc) + public void setJc(byte field_59_jc) { - this.field_62_jc = field_62_jc; + this.field_59_jc = field_59_jc; } /** * Get the fNoAllowOverlap field for the PAP record. */ - public byte getFNoAllowOverlap() + public boolean getFNoAllowOverlap() { - return field_63_fNoAllowOverlap; + return field_60_fNoAllowOverlap; } /** * Set the fNoAllowOverlap field for the PAP record. */ - public void setFNoAllowOverlap(byte field_63_fNoAllowOverlap) + public void setFNoAllowOverlap(boolean field_60_fNoAllowOverlap) { - this.field_63_fNoAllowOverlap = field_63_fNoAllowOverlap; + this.field_60_fNoAllowOverlap = field_60_fNoAllowOverlap; } /** @@ -1405,15 +1338,15 @@ public abstract class PAPAbstractType */ public BorderCode getBrcTop() { - return field_64_brcTop; + return field_61_brcTop; } /** * Set the brcTop field for the PAP record. */ - public void setBrcTop(BorderCode field_64_brcTop) + public void setBrcTop(BorderCode field_61_brcTop) { - this.field_64_brcTop = field_64_brcTop; + this.field_61_brcTop = field_61_brcTop; } /** @@ -1421,15 +1354,15 @@ public abstract class PAPAbstractType */ public BorderCode getBrcLeft() { - return field_65_brcLeft; + return field_62_brcLeft; } /** * Set the brcLeft field for the PAP record. */ - public void setBrcLeft(BorderCode field_65_brcLeft) + public void setBrcLeft(BorderCode field_62_brcLeft) { - this.field_65_brcLeft = field_65_brcLeft; + this.field_62_brcLeft = field_62_brcLeft; } /** @@ -1437,15 +1370,15 @@ public abstract class PAPAbstractType */ public BorderCode getBrcBottom() { - return field_66_brcBottom; + return field_63_brcBottom; } /** * Set the brcBottom field for the PAP record. */ - public void setBrcBottom(BorderCode field_66_brcBottom) + public void setBrcBottom(BorderCode field_63_brcBottom) { - this.field_66_brcBottom = field_66_brcBottom; + this.field_63_brcBottom = field_63_brcBottom; } /** @@ -1453,15 +1386,15 @@ public abstract class PAPAbstractType */ public BorderCode getBrcRight() { - return field_67_brcRight; + return field_64_brcRight; } /** * Set the brcRight field for the PAP record. */ - public void setBrcRight(BorderCode field_67_brcRight) + public void setBrcRight(BorderCode field_64_brcRight) { - this.field_67_brcRight = field_67_brcRight; + this.field_64_brcRight = field_64_brcRight; } /** @@ -1469,15 +1402,15 @@ public abstract class PAPAbstractType */ public BorderCode getBrcBetween() { - return field_68_brcBetween; + return field_65_brcBetween; } /** * Set the brcBetween field for the PAP record. */ - public void setBrcBetween(BorderCode field_68_brcBetween) + public void setBrcBetween(BorderCode field_65_brcBetween) { - this.field_68_brcBetween = field_68_brcBetween; + this.field_65_brcBetween = field_65_brcBetween; } /** @@ -1485,15 +1418,15 @@ public abstract class PAPAbstractType */ public BorderCode getBrcBar() { - return field_69_brcBar; + return field_66_brcBar; } /** * Set the brcBar field for the PAP record. */ - public void setBrcBar(BorderCode field_69_brcBar) + public void setBrcBar(BorderCode field_66_brcBar) { - this.field_69_brcBar = field_69_brcBar; + this.field_66_brcBar = field_66_brcBar; } /** @@ -1501,15 +1434,15 @@ public abstract class PAPAbstractType */ public ShadingDescriptor getShd() { - return field_70_shd; + return field_67_shd; } /** * Set the shd field for the PAP record. */ - public void setShd(ShadingDescriptor field_70_shd) + public void setShd(ShadingDescriptor field_67_shd) { - this.field_70_shd = field_70_shd; + this.field_67_shd = field_67_shd; } /** @@ -1517,15 +1450,15 @@ public abstract class PAPAbstractType */ public byte[] getAnld() { - return field_71_anld; + return field_68_anld; } /** * Set the anld field for the PAP record. */ - public void setAnld(byte[] field_71_anld) + public void setAnld(byte[] field_68_anld) { - this.field_71_anld = field_71_anld; + this.field_68_anld = field_68_anld; } /** @@ -1533,31 +1466,31 @@ public abstract class PAPAbstractType */ public byte[] getPhe() { - return field_72_phe; + return field_69_phe; } /** * Set the phe field for the PAP record. */ - public void setPhe(byte[] field_72_phe) + public void setPhe(byte[] field_69_phe) { - this.field_72_phe = field_72_phe; + this.field_69_phe = field_69_phe; } /** * Get the fPropRMark field for the PAP record. */ - public int getFPropRMark() + public boolean getFPropRMark() { - return field_73_fPropRMark; + return field_70_fPropRMark; } /** * Set the fPropRMark field for the PAP record. */ - public void setFPropRMark(int field_73_fPropRMark) + public void setFPropRMark(boolean field_70_fPropRMark) { - this.field_73_fPropRMark = field_73_fPropRMark; + this.field_70_fPropRMark = field_70_fPropRMark; } /** @@ -1565,15 +1498,15 @@ public abstract class PAPAbstractType */ public int getIbstPropRMark() { - return field_74_ibstPropRMark; + return field_71_ibstPropRMark; } /** * Set the ibstPropRMark field for the PAP record. */ - public void setIbstPropRMark(int field_74_ibstPropRMark) + public void setIbstPropRMark(int field_71_ibstPropRMark) { - this.field_74_ibstPropRMark = field_74_ibstPropRMark; + this.field_71_ibstPropRMark = field_71_ibstPropRMark; } /** @@ -1581,15 +1514,15 @@ public abstract class PAPAbstractType */ public DateAndTime getDttmPropRMark() { - return field_75_dttmPropRMark; + return field_72_dttmPropRMark; } /** * Set the dttmPropRMark field for the PAP record. */ - public void setDttmPropRMark(DateAndTime field_75_dttmPropRMark) + public void setDttmPropRMark(DateAndTime field_72_dttmPropRMark) { - this.field_75_dttmPropRMark = field_75_dttmPropRMark; + this.field_72_dttmPropRMark = field_72_dttmPropRMark; } /** @@ -1597,15 +1530,15 @@ public abstract class PAPAbstractType */ public int getItbdMac() { - return field_76_itbdMac; + return field_73_itbdMac; } /** * Set the itbdMac field for the PAP record. */ - public void setItbdMac(int field_76_itbdMac) + public void setItbdMac(int field_73_itbdMac) { - this.field_76_itbdMac = field_76_itbdMac; + this.field_73_itbdMac = field_73_itbdMac; } /** @@ -1613,15 +1546,15 @@ public abstract class PAPAbstractType */ public int[] getRgdxaTab() { - return field_77_rgdxaTab; + return field_74_rgdxaTab; } /** * Set the rgdxaTab field for the PAP record. */ - public void setRgdxaTab(int[] field_77_rgdxaTab) + public void setRgdxaTab(int[] field_74_rgdxaTab) { - this.field_77_rgdxaTab = field_77_rgdxaTab; + this.field_74_rgdxaTab = field_74_rgdxaTab; } /** @@ -1629,15 +1562,15 @@ public abstract class PAPAbstractType */ public byte[] getRgtbd() { - return field_78_rgtbd; + return field_75_rgtbd; } /** * Set the rgtbd field for the PAP record. */ - public void setRgtbd(byte[] field_78_rgtbd) + public void setRgtbd(byte[] field_75_rgtbd) { - this.field_78_rgtbd = field_78_rgtbd; + this.field_75_rgtbd = field_75_rgtbd; } /** @@ -1645,15 +1578,15 @@ public abstract class PAPAbstractType */ public byte[] getNumrm() { - return field_79_numrm; + return field_76_numrm; } /** * Set the numrm field for the PAP record. */ - public void setNumrm(byte[] field_79_numrm) + public void setNumrm(byte[] field_76_numrm) { - this.field_79_numrm = field_79_numrm; + this.field_76_numrm = field_76_numrm; } /** @@ -1661,15 +1594,15 @@ public abstract class PAPAbstractType */ public byte[] getPtap() { - return field_80_ptap; + return field_77_ptap; } /** * Set the ptap field for the PAP record. */ - public void setPtap(byte[] field_80_ptap) + public void setPtap(byte[] field_77_ptap) { - this.field_80_ptap = field_80_ptap; + this.field_77_ptap = field_77_ptap; } /** @@ -1735,5 +1668,4 @@ public abstract class PAPAbstractType } - -} // END OF CLASS \ No newline at end of file +} // END OF CLASS diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java index a35842285d..c1c8d20bb5 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java @@ -52,19 +52,19 @@ public final class ParagraphSprmCompressor if (newPAP.getFSideBySide() != oldPAP.getFSideBySide()) { // sprmPFSideBySide - size += SprmUtils.addSprm((short)0x2404, newPAP.getFSideBySide(), null, sprmList); + size += SprmUtils.addSprm((short)0x2404, newPAP.getFSideBySide(), sprmList); } if (newPAP.getFKeep() != oldPAP.getFKeep()) { - size += SprmUtils.addSprm((short)0x2405, newPAP.getFKeep(), null, sprmList); + size += SprmUtils.addSprm((short)0x2405, newPAP.getFKeep(), sprmList); } if (newPAP.getFKeepFollow() != oldPAP.getFKeepFollow()) { - size += SprmUtils.addSprm((short)0x2406, newPAP.getFKeepFollow(), null, sprmList); + size += SprmUtils.addSprm((short)0x2406, newPAP.getFKeepFollow(), sprmList); } if (newPAP.getFPageBreakBefore() != oldPAP.getFPageBreakBefore()) { - size += SprmUtils.addSprm((short)0x2407, newPAP.getFPageBreakBefore(), null, sprmList); + size += SprmUtils.addSprm((short)0x2407, newPAP.getFPageBreakBefore(), sprmList); } if (newPAP.getBrcl() != oldPAP.getBrcl()) { @@ -84,7 +84,7 @@ public final class ParagraphSprmCompressor } if (newPAP.getFNoLnn() != oldPAP.getFNoLnn()) { - size += SprmUtils.addSprm((short)0x240C, newPAP.getFNoLnn(), null, sprmList); + size += SprmUtils.addSprm((short)0x240C, newPAP.getFNoLnn(), sprmList); } if (newPAP.getItbdMac() != oldPAP.getItbdMac() || !Arrays.equals(newPAP.getRgdxaTab(), oldPAP.getRgdxaTab()) || @@ -161,22 +161,22 @@ public final class ParagraphSprmCompressor if (newPAP.getFDyaBeforeAuto() != oldPAP.getFDyaBeforeAuto()) { // sprmPFDyaBeforeAuto - size += SprmUtils.addSprm((short)0x245B, newPAP.getFDyaBeforeAuto(), null, sprmList); + size += SprmUtils.addSprm((short)0x245B, newPAP.getFDyaBeforeAuto(), sprmList); } if (newPAP.getFDyaAfterAuto() != oldPAP.getFDyaAfterAuto()) { // sprmPFDyaAfterAuto - size += SprmUtils.addSprm((short)0x245C, newPAP.getFDyaAfterAuto(), null, sprmList); + size += SprmUtils.addSprm((short)0x245C, newPAP.getFDyaAfterAuto(), sprmList); } if (newPAP.getFInTable() != oldPAP.getFInTable()) { // sprmPFInTable - size += SprmUtils.addSprm((short)0x2416, newPAP.getFInTable(), null, sprmList); + size += SprmUtils.addSprm((short)0x2416, newPAP.getFInTable(), sprmList); } if (newPAP.getFTtp() != oldPAP.getFTtp()) { // sprmPFTtp - size += SprmUtils.addSprm((short)0x2417, newPAP.getFTtp(), null, sprmList); + size += SprmUtils.addSprm((short)0x2417, newPAP.getFTtp(), sprmList); } if (newPAP.getDxaAbs() != oldPAP.getDxaAbs()) { @@ -234,14 +234,14 @@ public final class ParagraphSprmCompressor } if (newPAP.getFNoAutoHyph() != oldPAP.getFNoAutoHyph()) { - size += SprmUtils.addSprm((short)0x242A, newPAP.getFNoAutoHyph(), null, sprmList); + size += SprmUtils.addSprm((short)0x242A, newPAP.getFNoAutoHyph(), sprmList); } if (newPAP.getDyaHeight() != oldPAP.getDyaHeight() || newPAP.getFMinHeight() != oldPAP.getFMinHeight()) { // sprmPWHeightAbs short val = (short)newPAP.getDyaHeight(); - if (newPAP.getFMinHeight() > 0) + if (newPAP.getFMinHeight()) { val |= 0x8000; } @@ -270,12 +270,12 @@ public final class ParagraphSprmCompressor if (newPAP.getFLocked() != oldPAP.getFLocked()) { // sprmPFLocked - size += SprmUtils.addSprm((short)0x2430, newPAP.getFLocked(), null, sprmList); + size += SprmUtils.addSprm((short)0x2430, newPAP.getFLocked(), sprmList); } if (newPAP.getFWidowControl() != oldPAP.getFWidowControl()) { // sprmPFWidowControl - size += SprmUtils.addSprm((short)0x2431, newPAP.getFWidowControl(), null, sprmList); + size += SprmUtils.addSprm((short)0x2431, newPAP.getFWidowControl(), sprmList); } if (newPAP.getFKinsoku() != oldPAP.getFKinsoku()) { @@ -283,23 +283,23 @@ public final class ParagraphSprmCompressor } if (newPAP.getFWordWrap() != oldPAP.getFWordWrap()) { - size += SprmUtils.addSprm((short)0x2434, newPAP.getFWordWrap(), null, sprmList); + size += SprmUtils.addSprm((short)0x2434, newPAP.getFWordWrap(), sprmList); } if (newPAP.getFOverflowPunct() != oldPAP.getFOverflowPunct()) { - size += SprmUtils.addSprm((short)0x2435, newPAP.getFOverflowPunct(), null, sprmList); + size += SprmUtils.addSprm((short)0x2435, newPAP.getFOverflowPunct(), sprmList); } if (newPAP.getFTopLinePunct() != oldPAP.getFTopLinePunct()) { - size += SprmUtils.addSprm((short)0x2436, newPAP.getFTopLinePunct(), null, sprmList); + size += SprmUtils.addSprm((short)0x2436, newPAP.getFTopLinePunct(), sprmList); } if (newPAP.getFAutoSpaceDE() != oldPAP.getFAutoSpaceDE()) { - size += SprmUtils.addSprm((short)0x2437, newPAP.getFAutoSpaceDE(), null, sprmList); + size += SprmUtils.addSprm((short)0x2437, newPAP.getFAutoSpaceDE(), sprmList); } if (newPAP.getFAutoSpaceDN() != oldPAP.getFAutoSpaceDN()) { - size += SprmUtils.addSprm((short)0x2438, newPAP.getFAutoSpaceDN(), null, sprmList); + size += SprmUtils.addSprm((short)0x2438, newPAP.getFAutoSpaceDN(), sprmList); } if (newPAP.getWAlignFont() != oldPAP.getWAlignFont()) { @@ -337,7 +337,7 @@ public final class ParagraphSprmCompressor { // sprmPPropRMark byte[] buf = new byte[7]; - buf[0] = (byte)newPAP.getFPropRMark(); + buf[0] = (byte) ( newPAP.getFPropRMark() ? 1 : 0 ); LittleEndian.putShort(buf, 1, (short)newPAP.getIbstPropRMark()); newPAP.getDttmPropRMark().serialize(buf, 3); size += SprmUtils.addSprm((short)0xC63F, 0, buf, sprmList); @@ -350,12 +350,12 @@ public final class ParagraphSprmCompressor if (newPAP.getFBiDi() != oldPAP.getFBiDi()) { // sprmPFBiDi - size += SprmUtils.addSprm((short)0x2441, newPAP.getFBiDi(), null, sprmList); + size += SprmUtils.addSprm((short)0x2441, newPAP.getFBiDi(), sprmList); } if (newPAP.getFNumRMIns() != oldPAP.getFNumRMIns()) { // sprmPFNumRMIns - size += SprmUtils.addSprm((short)0x2443, newPAP.getFNumRMIns(), null, sprmList); + size += SprmUtils.addSprm((short)0x2443, newPAP.getFNumRMIns(), sprmList); } if (!Arrays.equals(newPAP.getNumrm(), oldPAP.getNumrm())) { @@ -365,12 +365,12 @@ public final class ParagraphSprmCompressor if (newPAP.getFInnerTableCell() != oldPAP.getFInnerTableCell()) { // sprmPFInnerTableCell - size += SprmUtils.addSprm((short)0x244b, newPAP.getFInnerTableCell(), null, sprmList); + size += SprmUtils.addSprm((short)0x244b, newPAP.getFInnerTableCell(), sprmList); } if (newPAP.getFTtpEmbedded() != oldPAP.getFTtpEmbedded()) { // sprmPFInnerTtp - size += SprmUtils.addSprm((short)0x244c, newPAP.getFTtpEmbedded(), null, sprmList); + size += SprmUtils.addSprm((short)0x244c, newPAP.getFTtpEmbedded(), sprmList); } // Page 55 of public specification begins diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java index 355dea8374..438d452c93 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java @@ -64,7 +64,7 @@ public final class ParagraphSprmUncompressor // PAPXs can contain table sprms if the paragraph marks the end of a // table row - if (sprm.getType() == SprmOperation.PAP_TYPE) + if (sprm.getType() == SprmOperation.TYPE_PAP) { try { @@ -135,16 +135,16 @@ public final class ParagraphSprmUncompressor newPAP.setJc ((byte) sprm.getOperand()); break; case 0x4: - newPAP.setFSideBySide ((byte) sprm.getOperand()); + newPAP.setFSideBySide (sprm.getOperand() != 0); break; case 0x5: - newPAP.setFKeep ((byte) sprm.getOperand()); + newPAP.setFKeep (sprm.getOperand() != 0); break; case 0x6: - newPAP.setFKeepFollow ((byte) sprm.getOperand()); + newPAP.setFKeepFollow (sprm.getOperand() != 0); break; case 0x7: - newPAP.setFPageBreakBefore ((byte) sprm.getOperand()); + newPAP.setFPageBreakBefore (sprm.getOperand() != 0); break; case 0x8: newPAP.setBrcl ((byte) sprm.getOperand()); @@ -159,7 +159,7 @@ public final class ParagraphSprmUncompressor newPAP.setIlfo (sprm.getOperand()); break; case 0xc: - newPAP.setFNoLnn ((byte) sprm.getOperand()); + newPAP.setFNoLnn (sprm.getOperand() != 0); break; case 0xd: /**handle tabs . variable parameter. seperate processing needed*/ @@ -195,10 +195,10 @@ public final class ParagraphSprmUncompressor break; case 0x16: // sprmPFInTable -- 0x2416 - newPAP.setFInTable( (byte) sprm.getOperand() ); + newPAP.setFInTable( sprm.getOperand() != 0); break; case 0x17: - newPAP.setFTtp ((byte) sprm.getOperand()); + newPAP.setFTtp ( sprm.getOperand() != 0); break; case 0x18: newPAP.setDxaAbs (sprm.getOperand()); @@ -274,7 +274,7 @@ public final class ParagraphSprmUncompressor newPAP.setBrcBar (new BorderCode(sprm.getGrpprl(), sprm.getGrpprlOffset())); break; case 0x2a: - newPAP.setFNoAutoHyph ((byte) sprm.getOperand()); + newPAP.setFNoAutoHyph (sprm.getOperand() != 0); break; case 0x2b: newPAP.setDyaHeight (sprm.getOperand()); @@ -292,32 +292,32 @@ public final class ParagraphSprmUncompressor newPAP.setDxaFromText (sprm.getOperand()); break; case 0x30: - newPAP.setFLocked ((byte) sprm.getOperand()); + newPAP.setFLocked (sprm.getOperand() != 0); break; case 0x31: - newPAP.setFWidowControl ((byte) sprm.getOperand()); + newPAP.setFWidowControl (sprm.getOperand() != 0); break; case 0x32: //undocumented break; case 0x33: - newPAP.setFKinsoku ((byte) sprm.getOperand()); + newPAP.setFKinsoku (sprm.getOperand() != 0); break; case 0x34: - newPAP.setFWordWrap ((byte) sprm.getOperand()); + newPAP.setFWordWrap (sprm.getOperand() != 0); break; case 0x35: - newPAP.setFOverflowPunct ((byte) sprm.getOperand()); + newPAP.setFOverflowPunct (sprm.getOperand() != 0); break; case 0x36: - newPAP.setFTopLinePunct ((byte) sprm.getOperand()); + newPAP.setFTopLinePunct (sprm.getOperand() != 0); break; case 0x37: - newPAP.setFAutoSpaceDE ((byte) sprm.getOperand()); + newPAP.setFAutoSpaceDE (sprm.getOperand() != 0); break; case 0x38: - newPAP.setFAutoSpaceDN ((byte) sprm.getOperand()); + newPAP.setFAutoSpaceDN (sprm.getOperand() != 0); break; case 0x39: newPAP.setWAlignFont (sprm.getOperand()); @@ -344,7 +344,7 @@ public final class ParagraphSprmUncompressor { byte[] varParam = sprm.getGrpprl(); int offset = sprm.getGrpprlOffset(); - newPAP.setFPropRMark (varParam[offset]); + newPAP.setFPropRMark (varParam[offset] != 0 ); newPAP.setIbstPropRMark (LittleEndian.getShort (varParam, offset + 1)); newPAP.setDttmPropRMark (new DateAndTime(varParam, offset + 3)); } @@ -364,12 +364,12 @@ public final class ParagraphSprmUncompressor break; case 0x41: // sprmPFBiDi - newPAP.setFBiDi((byte) sprm.getOperand()); + newPAP.setFBiDi(sprm.getOperand() != 0); break; case 0x43: //pap.fNumRMIns - newPAP.setFNumRMIns ((byte) sprm.getOperand()); + newPAP.setFNumRMIns (sprm.getOperand() != 0); break; case 0x44: @@ -389,10 +389,10 @@ public final class ParagraphSprmUncompressor break; case 0x47: - newPAP.setFUsePgsuSettings ((byte) sprm.getOperand()); + newPAP.setFUsePgsuSettings (sprm.getOperand() != 0); break; case 0x48: - newPAP.setFAdjustRight ((byte) sprm.getOperand()); + newPAP.setFAdjustRight (sprm.getOperand() != 0); break; case 0x49: // sprmPItap -- 0x6649 @@ -404,11 +404,11 @@ public final class ParagraphSprmUncompressor break; case 0x4b: // sprmPFInnerTableCell -- 0x244b - newPAP.setFInnerTableCell( (byte) sprm.getOperand() ); + newPAP.setFInnerTableCell( sprm.getOperand() != 0); break; case 0x4c: // sprmPFInnerTtp -- 0x244c - newPAP.setFTtpEmbedded( (byte) sprm.getOperand() ); + newPAP.setFTtpEmbedded( sprm.getOperand() != 0); break; case 0x61: // sprmPJc diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmBuffer.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmBuffer.java index 353566b69d..735856a463 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmBuffer.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmBuffer.java @@ -199,6 +199,17 @@ public final class SprmBuffer implements Cloneable addSprm(opcode, operand); } + public void updateSprm( short opcode, boolean operand ) + { + int grpprlOffset = findSprmOffset( opcode ); + if ( grpprlOffset != -1 ) + { + _buf[grpprlOffset] = (byte) ( operand ? 1 : 0 ); + return; + } + addSprm( opcode, operand ? 1 : 0 ); + } + public void updateSprm(short opcode, int operand) { int grpprlOffset = findSprmOffset(opcode); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUtils.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUtils.java index 51bc629dc9..8d9bd4f0e5 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUtils.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUtils.java @@ -50,6 +50,12 @@ public final class SprmUtils return sprm.length; } + public static int addSprm( short instruction, boolean param, + List list ) + { + return addSprm( instruction, param ? 1 : 0, null, list ); + } + public static int addSprm(short instruction, int param, byte[] varParam, List list) { int type = (instruction & 0xe000) >> 13; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java index 9640bc5c00..373ec546fa 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java @@ -124,7 +124,7 @@ public class Paragraph extends Range implements Cloneable { public boolean isInTable() { - return _props.getFInTable() != 0; + return _props.getFInTable(); } /** @@ -133,7 +133,7 @@ public class Paragraph extends Range implements Cloneable { */ public boolean isTableRowEnd() { - return _props.getFTtp() != 0 || _props.getFTtpEmbedded() != 0; + return _props.getFTtp() || _props.getFTtpEmbedded(); } public int getTableLevel() @@ -147,7 +147,7 @@ public class Paragraph extends Range implements Cloneable { */ public boolean isEmbeddedCellMark() { - return _props.getFInnerTableCell() != 0; + return _props.getFInnerTableCell(); } public int getJustification() @@ -163,86 +163,79 @@ public class Paragraph extends Range implements Cloneable { public boolean keepOnPage() { - return _props.getFKeep() != 0; + return _props.getFKeep(); } public void setKeepOnPage(boolean fKeep) { - byte keep = (byte)(fKeep ? 1 : 0); - _props.setFKeep(keep); - _papx.updateSprm(SPRM_FKEEP, keep); + _props.setFKeep(fKeep); + _papx.updateSprm(SPRM_FKEEP, fKeep); } public boolean keepWithNext() { - return _props.getFKeepFollow() != 0; + return _props.getFKeepFollow(); } public void setKeepWithNext(boolean fKeepFollow) { - byte keepFollow = (byte)(fKeepFollow ? 1 : 0); - _props.setFKeepFollow(keepFollow); - _papx.updateSprm(SPRM_FKEEPFOLLOW, keepFollow); + _props.setFKeepFollow(fKeepFollow); + _papx.updateSprm(SPRM_FKEEPFOLLOW, fKeepFollow); } public boolean pageBreakBefore() { - return _props.getFPageBreakBefore() != 0; + return _props.getFPageBreakBefore(); } public void setPageBreakBefore(boolean fPageBreak) { - byte pageBreak = (byte)(fPageBreak ? 1 : 0); - _props.setFPageBreakBefore(pageBreak); - _papx.updateSprm(SPRM_FPAGEBREAKBEFORE, pageBreak); + _props.setFPageBreakBefore(fPageBreak); + _papx.updateSprm(SPRM_FPAGEBREAKBEFORE, fPageBreak); } public boolean isLineNotNumbered() { - return _props.getFNoLnn() != 0; + return _props.getFNoLnn(); } public void setLineNotNumbered(boolean fNoLnn) { - byte noLnn = (byte)(fNoLnn ? 1 : 0); - _props.setFNoLnn(noLnn); - _papx.updateSprm(SPRM_FNOLINENUMB, noLnn); + _props.setFNoLnn(fNoLnn); + _papx.updateSprm(SPRM_FNOLINENUMB, fNoLnn); } public boolean isSideBySide() { - return _props.getFSideBySide() != 0; + return _props.getFSideBySide(); } public void setSideBySide(boolean fSideBySide) { - byte sideBySide = (byte)(fSideBySide ? 1 : 0); - _props.setFSideBySide(sideBySide); - _papx.updateSprm(SPRM_FSIDEBYSIDE, sideBySide); + _props.setFSideBySide(fSideBySide); + _papx.updateSprm(SPRM_FSIDEBYSIDE, fSideBySide); } public boolean isAutoHyphenated() { - return _props.getFNoAutoHyph() == 0; + return !_props.getFNoAutoHyph(); } public void setAutoHyphenated(boolean autoHyph) { - byte auto = (byte)(!autoHyph ? 1 : 0); - _props.setFNoAutoHyph(auto); - _papx.updateSprm(SPRM_FNOAUTOHYPH, auto); + _props.setFNoAutoHyph(!autoHyph); + _papx.updateSprm(SPRM_FNOAUTOHYPH, !autoHyph); } public boolean isWidowControlled() { - return _props.getFWidowControl() != 0; + return _props.getFWidowControl(); } public void setWidowControl(boolean widowControl) { - byte widow = (byte)(widowControl ? 1 : 0); - _props.setFWidowControl(widow); - _papx.updateSprm(SPRM_FWIDOWCONTROL, widow); + _props.setFWidowControl(widowControl); + _papx.updateSprm(SPRM_FWIDOWCONTROL, widowControl); } public int getIndentFromRight() @@ -313,26 +306,24 @@ public class Paragraph extends Range implements Cloneable { public boolean isKinsoku() { - return _props.getFKinsoku() != 0; + return _props.getFKinsoku(); } public void setKinsoku(boolean kinsoku) { - byte kin = (byte)(kinsoku ? 1 : 0); - _props.setFKinsoku(kin); - _papx.updateSprm(SPRM_FKINSOKU, kin); + _props.setFKinsoku(kinsoku); + _papx.updateSprm(SPRM_FKINSOKU, kinsoku); } public boolean isWordWrapped() { - return _props.getFWordWrap() != 0; + return _props.getFWordWrap(); } public void setWordWrapped(boolean wrap) { - byte wordWrap = (byte)(wrap ? 1 : 0); - _props.setFWordWrap(wordWrap); - _papx.updateSprm(SPRM_FWORDWRAP, wordWrap); + _props.setFWordWrap(wrap); + _papx.updateSprm(SPRM_FWORDWRAP, wrap); } public int getFontAlignment() @@ -476,12 +467,12 @@ public class Paragraph extends Range implements Cloneable { void setTableRowEnd(TableProperties props) { - setTableRowEnd((byte)1); + setTableRowEnd(true); byte[] grpprl = TableSprmCompressor.compressTableProperty(props); _papx.append(grpprl); } - private void setTableRowEnd(byte val) + private void setTableRowEnd(boolean val) { _props.setFTtp(val); _papx.updateSprm(SPRM_FTTP, val); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java index 9e91d6c83d..7583b59046 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java @@ -20,275 +20,315 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.hwpf.model.types.PAPAbstractType; public final class ParagraphProperties extends PAPAbstractType implements - Cloneable { + Cloneable +{ private boolean jcLogical = false; - - public ParagraphProperties() { - setAnld(new byte[84]); - setBrcTop(new BorderCode()); - setBrcLeft(new BorderCode()); - setBrcBottom(new BorderCode()); - setBrcRight(new BorderCode()); - setBrcBetween(new BorderCode()); - setBrcBar(new BorderCode()); - setDcs( new DropCapSpecifier() ); - setLspd( new LineSpacingDescriptor() ); - setShd( new ShadingDescriptor() ); - setPhe( new byte[12] ); - setWidowControl(true); - getLspd().setMultiLinespace((short) 1); - getLspd().setDyaLine((short) 240); - setLvl((byte) 9); - setRgdxaTab(new int[0]); - setRgtbd(new byte[0]); - setDttmPropRMark(new DateAndTime()); + public ParagraphProperties() + { + setAnld( new byte[84] ); + setPhe( new byte[12] ); } - public int getJustification() { - if (jcLogical) { - if (getFBiDi() == 0) { - return getJc(); - } - - switch (getJc()) { - case 0: - return 2; - case 2: - return 0; - default: - return getJc(); - } - } - - return getJc(); + public Object clone() throws CloneNotSupportedException + { + ParagraphProperties pp = (ParagraphProperties) super.clone(); + pp.setAnld( getAnld().clone() ); + pp.setBrcTop( (BorderCode) getBrcTop().clone() ); + pp.setBrcLeft( (BorderCode) getBrcLeft().clone() ); + pp.setBrcBottom( (BorderCode) getBrcBottom().clone() ); + pp.setBrcRight( (BorderCode) getBrcRight().clone() ); + pp.setBrcBetween( (BorderCode) getBrcBetween().clone() ); + pp.setBrcBar( (BorderCode) getBrcBar().clone() ); + pp.setDcs( getDcs().clone() ); + pp.setLspd( (LineSpacingDescriptor) getLspd().clone() ); + pp.setShd( (ShadingDescriptor) getShd().clone() ); + pp.setPhe( getPhe().clone() ); + return pp; } - public void setJustification(byte jc) { - super.setJc(jc); - this.jcLogical = false; + public BorderCode getBarBorder() + { + return super.getBrcBar(); } - public void setJustificationLogical(byte jc) { - super.setJc(jc); - this.jcLogical = true; + public BorderCode getBottomBorder() + { + return super.getBrcBottom(); } - public boolean keepOnPage() { - return super.getFKeep() != 0; + public DropCapSpecifier getDropCap() + { + return super.getDcs(); } - public void setKeepOnPage(boolean fKeep) { - super.setFKeep((byte) (fKeep ? 1 : 0)); + public int getFirstLineIndent() + { + return super.getDxaLeft1(); } - public boolean keepWithNext() { - return super.getFKeepFollow() != 0; + public int getFontAlignment() + { + return super.getWAlignFont(); } - public void setKeepWithNext(boolean fKeepFollow) { - super.setFKeepFollow((byte) (fKeepFollow ? 1 : 0)); + public int getIndentFromLeft() + { + return super.getDxaLeft(); } - public boolean pageBreakBefore() { - return super.getFPageBreakBefore() != 0; + public int getIndentFromRight() + { + return super.getDxaRight(); } - public void setPageBreakBefore(boolean fPageBreak) { - super.setFPageBreakBefore((byte) (fPageBreak ? 1 : 0)); + public int getJustification() + { + if ( jcLogical ) + { + if ( !getFBiDi() ) + return getJc(); + + switch ( getJc() ) + { + case 0: + return 2; + case 2: + return 0; + default: + return getJc(); + } + } + + return getJc(); } - public boolean isLineNotNumbered() { - return super.getFNoLnn() != 0; + public BorderCode getLeftBorder() + { + return super.getBrcLeft(); } - public void setLineNotNumbered(boolean fNoLnn) { - super.setFNoLnn((byte) (fNoLnn ? 1 : 0)); + public LineSpacingDescriptor getLineSpacing() + { + return super.getLspd(); } - public boolean isSideBySide() { - return super.getFSideBySide() != 0; + public BorderCode getRightBorder() + { + return super.getBrcRight(); } - public void setSideBySide(boolean fSideBySide) { - super.setFSideBySide((byte) (fSideBySide ? 1 : 0)); + public ShadingDescriptor getShading() + { + return super.getShd(); } - public boolean isAutoHyphenated() { - return super.getFNoAutoHyph() == 0; + public int getSpacingAfter() + { + return super.getDyaAfter(); } - public void setAutoHyphenated(boolean auto) { - super.setFNoAutoHyph((byte) (!auto ? 1 : 0)); + public int getSpacingBefore() + { + return super.getDyaBefore(); } - public boolean isWidowControlled() { - return super.getFWidowControl() != 0; + public BorderCode getTopBorder() + { + return super.getBrcTop(); } - public void setWidowControl(boolean widowControl) { - super.setFWidowControl((byte) (widowControl ? 1 : 0)); + public boolean isAutoHyphenated() + { + return !super.getFNoAutoHyph(); } - public int getIndentFromRight() { - return super.getDxaRight(); + public boolean isBackward() + { + return super.isFBackward(); } - public void setIndentFromRight(int dxaRight) { - super.setDxaRight(dxaRight); + public boolean isKinsoku() + { + return super.getFKinsoku(); } - public int getIndentFromLeft() { - return super.getDxaLeft(); + public boolean isLineNotNumbered() + { + return super.getFNoLnn(); } - public void setIndentFromLeft(int dxaLeft) { - super.setDxaLeft(dxaLeft); + public boolean isSideBySide() + { + return super.getFSideBySide(); } - public int getFirstLineIndent() { - return super.getDxaLeft1(); + public boolean isVertical() + { + return super.isFVertical(); } - public void setFirstLineIndent(int first) { - super.setDxaLeft1(first); + public boolean isWidowControlled() + { + return super.getFWidowControl(); } - public LineSpacingDescriptor getLineSpacing() { - return super.getLspd(); + public boolean isWordWrapped() + { + return super.getFWordWrap(); } - public void setLineSpacing(LineSpacingDescriptor lspd) { - super.setLspd(lspd); + public boolean keepOnPage() + { + return super.getFKeep(); } - public int getSpacingBefore() { - return super.getDyaBefore(); + public boolean keepWithNext() + { + return super.getFKeepFollow(); } - public void setSpacingBefore(int before) { - super.setDyaBefore(before); + public boolean pageBreakBefore() + { + return super.getFPageBreakBefore(); } - public int getSpacingAfter() { - return super.getDyaAfter(); + public void setAutoHyphenated( boolean auto ) + { + super.setFNoAutoHyph( !auto ); } - public void setSpacingAfter(int after) { - super.setDyaAfter(after); + public void setBackward( boolean bward ) + { + super.setFBackward( bward ); } - public boolean isKinsoku() { - return super.getFKinsoku() != 0; + public void setBarBorder( BorderCode bar ) + { + super.setBrcBar( bar ); } - public void setKinsoku(boolean kinsoku) { - super.setFKinsoku((byte) (kinsoku ? 1 : 0)); + public void setBottomBorder( BorderCode bottom ) + { + super.setBrcBottom( bottom ); } - public boolean isWordWrapped() { - return super.getFWordWrap() != 0; + public void setDropCap( DropCapSpecifier dcs ) + { + super.setDcs( dcs ); } - public void setWordWrapped(boolean wrap) { - super.setFWordWrap((byte) (wrap ? 1 : 0)); + public void setFirstLineIndent( int first ) + { + super.setDxaLeft1( first ); } - public int getFontAlignment() { - return super.getWAlignFont(); + public void setFontAlignment( int align ) + { + super.setWAlignFont( align ); } - public void setFontAlignment(int align) { - super.setWAlignFont(align); + public void setIndentFromLeft( int dxaLeft ) + { + super.setDxaLeft( dxaLeft ); } - public boolean isVertical() { - return super.isFVertical(); + public void setIndentFromRight( int dxaRight ) + { + super.setDxaRight( dxaRight ); } - public void setVertical(boolean vertical) { - super.setFVertical(vertical); + public void setJustification( byte jc ) + { + super.setJc( jc ); + this.jcLogical = false; } - public boolean isBackward() { - return super.isFBackward(); + public void setJustificationLogical( byte jc ) + { + super.setJc( jc ); + this.jcLogical = true; } - public void setBackward(boolean bward) { - super.setFBackward(bward); + public void setKeepOnPage( boolean fKeep ) + { + super.setFKeep( fKeep ); } - public BorderCode getTopBorder() { - return super.getBrcTop(); + public void setKeepWithNext( boolean fKeepFollow ) + { + super.setFKeepFollow( fKeepFollow ); } - public void setTopBorder(BorderCode top) { - super.setBrcTop(top); + public void setKinsoku( boolean kinsoku ) + { + super.setFKinsoku( kinsoku ); } - public BorderCode getLeftBorder() { - return super.getBrcLeft(); + public void setLeftBorder( BorderCode left ) + { + super.setBrcLeft( left ); } - public void setLeftBorder(BorderCode left) { - super.setBrcLeft(left); + public void setLineNotNumbered( boolean fNoLnn ) + { + super.setFNoLnn( fNoLnn ); } - public BorderCode getBottomBorder() { - return super.getBrcBottom(); + public void setLineSpacing( LineSpacingDescriptor lspd ) + { + super.setLspd( lspd ); } - public void setBottomBorder(BorderCode bottom) { - super.setBrcBottom(bottom); + public void setPageBreakBefore( boolean fPageBreak ) + { + super.setFPageBreakBefore( fPageBreak ); } - public BorderCode getRightBorder() { - return super.getBrcRight(); + public void setRightBorder( BorderCode right ) + { + super.setBrcRight( right ); } - public void setRightBorder(BorderCode right) { - super.setBrcRight(right); + public void setShading( ShadingDescriptor shd ) + { + super.setShd( shd ); } - public BorderCode getBarBorder() { - return super.getBrcBar(); + public void setSideBySide( boolean fSideBySide ) + { + super.setFSideBySide( fSideBySide ); } - public void setBarBorder(BorderCode bar) { - super.setBrcBar(bar); + public void setSpacingAfter( int after ) + { + super.setDyaAfter( after ); } - public ShadingDescriptor getShading() { - return super.getShd(); + public void setSpacingBefore( int before ) + { + super.setDyaBefore( before ); } - public void setShading(ShadingDescriptor shd) { - super.setShd(shd); + public void setTopBorder( BorderCode top ) + { + super.setBrcTop( top ); } - public DropCapSpecifier getDropCap() { - return super.getDcs(); + public void setVertical( boolean vertical ) + { + super.setFVertical( vertical ); } - public void setDropCap(DropCapSpecifier dcs) { - super.setDcs(dcs); + public void setWidowControl( boolean widowControl ) + { + super.setFWidowControl( widowControl ); } - public Object clone() throws CloneNotSupportedException { - ParagraphProperties pp = (ParagraphProperties) super.clone(); - pp.setAnld(getAnld().clone()); - pp.setBrcTop((BorderCode) getBrcTop().clone()); - pp.setBrcLeft((BorderCode) getBrcLeft().clone()); - pp.setBrcBottom((BorderCode) getBrcBottom().clone()); - pp.setBrcRight((BorderCode) getBrcRight().clone()); - pp.setBrcBetween((BorderCode) getBrcBetween().clone()); - pp.setBrcBar((BorderCode) getBrcBar().clone()); - pp.setDcs( getDcs().clone() ); - pp.setLspd( (LineSpacingDescriptor) getLspd().clone() ); - pp.setShd( (ShadingDescriptor) getShd().clone() ); - pp.setPhe( getPhe().clone() ); - return pp; + public void setWordWrapped( boolean wrap ) + { + super.setFWordWrap( wrap ); } } diff --git a/src/types/definitions/pap_type.xml b/src/types/definitions/pap_type.xml index e7c181361b..e65bca8bc8 100644 --- a/src/types/definitions/pap_type.xml +++ b/src/types/definitions/pap_type.xml @@ -24,90 +24,107 @@ S. Ryan Ackley - - - - - - - + + + + + + + + + + + + + + + + + + - + - + - - - + + + - - + + - + - + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + - - + + - + - - + + @@ -115,7 +132,7 @@ - + @@ -127,7 +144,7 @@ - + diff --git a/src/types/styles/hdftype.xsl b/src/types/styles/hdftype.xsl index 9667fccb6b..ec550650ef 100644 --- a/src/types/styles/hdftype.xsl +++ b/src/types/styles/hdftype.xsl @@ -82,6 +82,33 @@ public abstract class Abstrac ; + + + + + + + + + + this. + + = new + + [0]; + + + + + + this. + + = new + + (); + + + } @@ -275,12 +302,20 @@ public abstract class Abstrac builder.append(" (").append(get ()).append(" )\n"); - + - buffer.append(" . = ").append(()).append('\n'); - + + + + builder.append(" . + + = ").append( + + ()).append('\n'); + + * @author