From 545cde33742274427cab37af8f8c4199ae9b873a Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Sat, 18 Jun 2011 08:57:10 +0000 Subject: [PATCH] Support for sprmPJc paragraph SPRM and handling of additional properties in ParagraphSprmCompressor, see Bugzilla 51389 and 51390 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1137143 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/status.xml | 2 + .../poi/hwpf/model/types/PAPAbstractType.java | 1849 ++++++++++------- .../hwpf/sprm/ParagraphSprmCompressor.java | 343 +-- .../hwpf/sprm/ParagraphSprmUncompressor.java | 6 +- .../hwpf/usermodel/ParagraphProperties.java | 455 ++-- src/types/definitions/pap_type.xml | 110 +- 6 files changed, 1631 insertions(+), 1134 deletions(-) diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index a79dc31eb..77ba26574 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,8 @@ + 51390 - Added handling of additional properties to HWPF ParagraphSprmCompressor + 51389 - Support for sprmPJc paragraph SPRM in HWPF 48469 - New Case Study for PI web site 50681 - Avoid exceptions in HSSFDataFormat.getDataFormatString() 50681 - Fixed autosizing columns beyond 255 character limit 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 158edb34e..8fb95da6b 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 @@ -18,93 +18,107 @@ package org.apache.poi.hwpf.model.types; + +import org.apache.poi.util.BitField; +import org.apache.poi.util.LittleEndian; +import org.apache.poi.util.StringUtil; +import org.apache.poi.util.HexDump; import org.apache.poi.hdf.model.hdftypes.HDFType; import org.apache.poi.hwpf.usermodel.*; -import org.apache.poi.util.BitField; -import org.apache.poi.util.BitFieldFactory; /** * Paragraph Properties. * NOTE: This source is automatically generated please do not modify this file. Either subclass or * remove the record in src/records/definitions. - * + * @author S. Ryan Ackley */ -public abstract class PAPAbstractType implements HDFType { +public abstract class PAPAbstractType + implements HDFType +{ protected int field_1_istd; - protected byte field_2_jc; + protected byte field_2_fSideBySide; protected byte field_3_fKeep; protected byte field_4_fKeepFollow; protected byte field_5_fPageBreakBefore; - protected byte field_6_fBrLnAbove; - protected byte field_7_fBrLnBelow; - protected byte field_8_pcVert; - protected byte field_9_pcHorz; - protected byte field_10_brcp; - protected byte field_11_brcl; - protected byte field_12_ilvl; - protected byte field_13_fNoLnn; - protected int field_14_ilfo; - protected byte field_15_fSideBySide; - protected byte field_16_fNoAutoHyph; - protected byte field_17_fWidowControl; - protected int field_18_dxaRight; - protected int field_19_dxaLeft; - protected int field_20_dxaLeft1; - protected LineSpacingDescriptor field_21_lspd; - protected int field_22_dyaBefore; - protected int field_23_dyaAfter; - protected byte[] field_24_phe; - protected byte field_25_fCrLf; - protected byte field_26_fUsePgsuSettings; - protected byte field_27_fAdjustRight; - protected byte field_28_fKinsoku; - protected byte field_29_fWordWrap; - protected byte field_30_fOverflowPunct; - protected byte field_31_fTopLinePunct; - protected byte field_32_fAutoSpaceDE; - protected byte field_33_fAutoSpaceDN; - protected int field_34_wAlignFont; - protected short field_35_fontAlign; - private static BitField fVertical = BitFieldFactory.getInstance(0x0001); - private static BitField fBackward = BitFieldFactory.getInstance(0x0002); - private static BitField fRotateFont = BitFieldFactory.getInstance(0x0004); - protected byte field_36_fBackward; - protected byte field_37_fRotateFont; - protected byte field_38_fInTable; - protected byte field_39_fTtp; - protected byte field_40_wr; - protected byte field_41_fLocked; - protected byte[] field_42_ptap; - protected int field_43_dxaAbs; - protected int field_44_dyaAbs; - protected int field_45_dxaWidth; - protected BorderCode field_46_brcTop; - protected BorderCode field_47_brcLeft; - protected BorderCode field_48_brcBottom; - protected BorderCode field_49_brcRight; - protected BorderCode field_50_brcBetween; - protected BorderCode field_51_brcBar; - protected int field_52_dxaFromText; - protected int field_53_dyaFromText; - protected int field_54_dyaHeight; - protected byte field_55_fMinHeight; - protected ShadingDescriptor field_56_shd; - protected DropCapSpecifier field_57_dcs; - protected byte field_58_lvl; - protected byte field_59_fNumRMIns; - protected byte[] field_60_anld; - protected int field_61_fPropRMark; - protected int field_62_ibstPropRMark; - protected DateAndTime field_63_dttmPropRMark; - protected byte[] field_64_numrm; - protected int field_65_itbdMac; - protected int[] field_66_rgdxaTab; - protected byte[] field_67_rgtbd; - protected byte field_68_tableLevel; - protected byte field_69_fTtpEmbedded; - protected byte field_70_embeddedCellMark; + 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; + 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 short field_50_dxcRight; + protected short field_51_dxcLeft; + protected short field_52_dxcLeft1; + protected byte field_53_fDyaBeforeAuto; + protected byte field_54_fDyaAfterAuto; + protected int field_55_dxaRight; + protected int field_56_dxaLeft; + protected int field_57_dxaLeft1; + protected byte field_58_jc; + protected byte field_59_fNoAllowOverlap; + protected BorderCode field_60_brcTop; + protected BorderCode field_61_brcLeft; + protected BorderCode field_62_brcBottom; + protected BorderCode field_63_brcRight; + protected BorderCode field_64_brcBetween; + protected BorderCode field_65_brcBar; + protected ShadingDescriptor field_66_shd; + protected byte[] field_67_anld; + protected byte[] field_68_phe; + protected int field_69_fPropRMark; + protected int field_70_ibstPropRMark; + protected DateAndTime field_71_dttmPropRMark; + protected int field_72_itbdMac; + protected int[] field_73_rgdxaTab; + protected byte[] field_74_rgtbd; + protected byte[] field_75_numrm; + protected byte[] field_76_ptap; + protected byte field_77_tableLevel; + protected byte field_78_fTtpEmbedded; + protected byte field_79_embeddedCellMark; public PAPAbstractType() @@ -112,12 +126,263 @@ public abstract class PAPAbstractType implements HDFType { } + + 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(" .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(" .tableLevel = "); + buffer.append(" (").append(getTableLevel()).append(" )\n"); + + buffer.append(" .fTtpEmbedded = "); + buffer.append(" (").append(getFTtpEmbedded()).append(" )\n"); + + buffer.append(" .embeddedCellMark = "); + buffer.append(" (").append(getEmbeddedCellMark()).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 + 1 + 1 + 1 + 1 + 1 + 2 + 1 + 1 + 1 + 4 + 4 + 4 + 4 + 4 + 4 + 12 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 2 + 2 + 1 + 1 + 1 + 1 + 1 + 1 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 2 + 1 + 2 + 2 + 1 + 1 + 84 + 1 + 2 + 4 + 128 + 2 + 128 + 128 + 1 + 1 + 1; + 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 + 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 + 1 + 1 + 1; } @@ -139,19 +404,19 @@ public abstract class PAPAbstractType implements HDFType { } /** - * Get the jc field for the PAP record. + * Get the fSideBySide field for the PAP record. */ - public byte getJc() + public byte getFSideBySide() { - return field_2_jc; + return field_2_fSideBySide; } /** - * Set the jc field for the PAP record. + * Set the fSideBySide field for the PAP record. */ - public void setJc(byte field_2_jc) + public void setFSideBySide(byte field_2_fSideBySide) { - this.field_2_jc = field_2_jc; + this.field_2_fSideBySide = field_2_fSideBySide; } /** @@ -203,67 +468,19 @@ public abstract class PAPAbstractType implements HDFType { } /** - * Get the fBrLnAbove field for the PAP record. + * Get the brcl field for the PAP record. */ - public byte getFBrLnAbove() + public byte getBrcl() { - return field_6_fBrLnAbove; + return field_6_brcl; } /** - * Set the fBrLnAbove field for the PAP record. + * Set the brcl field for the PAP record. */ - public void setFBrLnAbove(byte field_6_fBrLnAbove) + public void setBrcl(byte field_6_brcl) { - this.field_6_fBrLnAbove = field_6_fBrLnAbove; - } - - /** - * Get the fBrLnBelow field for the PAP record. - */ - public byte getFBrLnBelow() - { - return field_7_fBrLnBelow; - } - - /** - * Set the fBrLnBelow field for the PAP record. - */ - public void setFBrLnBelow(byte field_7_fBrLnBelow) - { - this.field_7_fBrLnBelow = field_7_fBrLnBelow; - } - - /** - * Get the pcVert field for the PAP record. - */ - public byte getPcVert() - { - return field_8_pcVert; - } - - /** - * Set the pcVert field for the PAP record. - */ - public void setPcVert(byte field_8_pcVert) - { - this.field_8_pcVert = field_8_pcVert; - } - - /** - * Get the pcHorz field for the PAP record. - */ - public byte getPcHorz() - { - return field_9_pcHorz; - } - - /** - * Set the pcHorz field for the PAP record. - */ - public void setPcHorz(byte field_9_pcHorz) - { - this.field_9_pcHorz = field_9_pcHorz; + this.field_6_brcl = field_6_brcl; } /** @@ -271,31 +488,15 @@ public abstract class PAPAbstractType implements HDFType { */ public byte getBrcp() { - return field_10_brcp; + return field_7_brcp; } /** * Set the brcp field for the PAP record. */ - public void setBrcp(byte field_10_brcp) + public void setBrcp(byte field_7_brcp) { - this.field_10_brcp = field_10_brcp; - } - - /** - * Get the brcl field for the PAP record. - */ - public byte getBrcl() - { - return field_11_brcl; - } - - /** - * Set the brcl field for the PAP record. - */ - public void setBrcl(byte field_11_brcl) - { - this.field_11_brcl = field_11_brcl; + this.field_7_brcp = field_7_brcp; } /** @@ -303,31 +504,15 @@ public abstract class PAPAbstractType implements HDFType { */ public byte getIlvl() { - return field_12_ilvl; + return field_8_ilvl; } /** * Set the ilvl field for the PAP record. */ - public void setIlvl(byte field_12_ilvl) + public void setIlvl(byte field_8_ilvl) { - this.field_12_ilvl = field_12_ilvl; - } - - /** - * Get the fNoLnn field for the PAP record. - */ - public byte getFNoLnn() - { - return field_13_fNoLnn; - } - - /** - * Set the fNoLnn field for the PAP record. - */ - public void setFNoLnn(byte field_13_fNoLnn) - { - this.field_13_fNoLnn = field_13_fNoLnn; + this.field_8_ilvl = field_8_ilvl; } /** @@ -335,111 +520,31 @@ public abstract class PAPAbstractType implements HDFType { */ public int getIlfo() { - return field_14_ilfo; + return field_9_ilfo; } /** * Set the ilfo field for the PAP record. */ - public void setIlfo(int field_14_ilfo) + public void setIlfo(int field_9_ilfo) { - this.field_14_ilfo = field_14_ilfo; + this.field_9_ilfo = field_9_ilfo; } /** - * Get the fSideBySide field for the PAP record. + * Get the fNoLnn field for the PAP record. */ - public byte getFSideBySide() + public byte getFNoLnn() { - return field_15_fSideBySide; + return field_10_fNoLnn; } /** - * Set the fSideBySide field for the PAP record. + * Set the fNoLnn field for the PAP record. */ - public void setFSideBySide(byte field_15_fSideBySide) + public void setFNoLnn(byte field_10_fNoLnn) { - this.field_15_fSideBySide = field_15_fSideBySide; - } - - /** - * Get the fNoAutoHyph field for the PAP record. - */ - public byte getFNoAutoHyph() - { - return field_16_fNoAutoHyph; - } - - /** - * Set the fNoAutoHyph field for the PAP record. - */ - public void setFNoAutoHyph(byte field_16_fNoAutoHyph) - { - this.field_16_fNoAutoHyph = field_16_fNoAutoHyph; - } - - /** - * Get the fWidowControl field for the PAP record. - */ - public byte getFWidowControl() - { - return field_17_fWidowControl; - } - - /** - * Set the fWidowControl field for the PAP record. - */ - public void setFWidowControl(byte field_17_fWidowControl) - { - this.field_17_fWidowControl = field_17_fWidowControl; - } - - /** - * Get the dxaRight field for the PAP record. - */ - public int getDxaRight() - { - return field_18_dxaRight; - } - - /** - * Set the dxaRight field for the PAP record. - */ - public void setDxaRight(int field_18_dxaRight) - { - this.field_18_dxaRight = field_18_dxaRight; - } - - /** - * Get the dxaLeft field for the PAP record. - */ - public int getDxaLeft() - { - return field_19_dxaLeft; - } - - /** - * Set the dxaLeft field for the PAP record. - */ - public void setDxaLeft(int field_19_dxaLeft) - { - this.field_19_dxaLeft = field_19_dxaLeft; - } - - /** - * Get the dxaLeft1 field for the PAP record. - */ - public int getDxaLeft1() - { - return field_20_dxaLeft1; - } - - /** - * Set the dxaLeft1 field for the PAP record. - */ - public void setDxaLeft1(int field_20_dxaLeft1) - { - this.field_20_dxaLeft1 = field_20_dxaLeft1; + this.field_10_fNoLnn = field_10_fNoLnn; } /** @@ -447,15 +552,15 @@ public abstract class PAPAbstractType implements HDFType { */ public LineSpacingDescriptor getLspd() { - return field_21_lspd; + return field_11_lspd; } /** * Set the lspd field for the PAP record. */ - public void setLspd(LineSpacingDescriptor field_21_lspd) + public void setLspd(LineSpacingDescriptor field_11_lspd) { - this.field_21_lspd = field_21_lspd; + this.field_11_lspd = field_11_lspd; } /** @@ -463,15 +568,15 @@ public abstract class PAPAbstractType implements HDFType { */ public int getDyaBefore() { - return field_22_dyaBefore; + return field_12_dyaBefore; } /** * Set the dyaBefore field for the PAP record. */ - public void setDyaBefore(int field_22_dyaBefore) + public void setDyaBefore(int field_12_dyaBefore) { - this.field_22_dyaBefore = field_22_dyaBefore; + this.field_12_dyaBefore = field_12_dyaBefore; } /** @@ -479,239 +584,15 @@ public abstract class PAPAbstractType implements HDFType { */ public int getDyaAfter() { - return field_23_dyaAfter; + return field_13_dyaAfter; } /** * Set the dyaAfter field for the PAP record. */ - public void setDyaAfter(int field_23_dyaAfter) + public void setDyaAfter(int field_13_dyaAfter) { - this.field_23_dyaAfter = field_23_dyaAfter; - } - - /** - * Get the phe field for the PAP record. - */ - public byte[] getPhe() - { - return field_24_phe; - } - - /** - * Set the phe field for the PAP record. - */ - public void setPhe(byte[] field_24_phe) - { - this.field_24_phe = field_24_phe; - } - - /** - * Get the fCrLf field for the PAP record. - */ - public byte getFCrLf() - { - return field_25_fCrLf; - } - - /** - * Set the fCrLf field for the PAP record. - */ - public void setFCrLf(byte field_25_fCrLf) - { - this.field_25_fCrLf = field_25_fCrLf; - } - - /** - * Get the fUsePgsuSettings field for the PAP record. - */ - public byte getFUsePgsuSettings() - { - return field_26_fUsePgsuSettings; - } - - /** - * Set the fUsePgsuSettings field for the PAP record. - */ - public void setFUsePgsuSettings(byte field_26_fUsePgsuSettings) - { - this.field_26_fUsePgsuSettings = field_26_fUsePgsuSettings; - } - - /** - * Get the fAdjustRight field for the PAP record. - */ - public byte getFAdjustRight() - { - return field_27_fAdjustRight; - } - - /** - * Set the fAdjustRight field for the PAP record. - */ - public void setFAdjustRight(byte field_27_fAdjustRight) - { - this.field_27_fAdjustRight = field_27_fAdjustRight; - } - - /** - * Get the fKinsoku field for the PAP record. - */ - public byte getFKinsoku() - { - return field_28_fKinsoku; - } - - /** - * Set the fKinsoku field for the PAP record. - */ - public void setFKinsoku(byte field_28_fKinsoku) - { - this.field_28_fKinsoku = field_28_fKinsoku; - } - - /** - * Get the fWordWrap field for the PAP record. - */ - public byte getFWordWrap() - { - return field_29_fWordWrap; - } - - /** - * Set the fWordWrap field for the PAP record. - */ - public void setFWordWrap(byte field_29_fWordWrap) - { - this.field_29_fWordWrap = field_29_fWordWrap; - } - - /** - * Get the fOverflowPunct field for the PAP record. - */ - public byte getFOverflowPunct() - { - return field_30_fOverflowPunct; - } - - /** - * Set the fOverflowPunct field for the PAP record. - */ - public void setFOverflowPunct(byte field_30_fOverflowPunct) - { - this.field_30_fOverflowPunct = field_30_fOverflowPunct; - } - - /** - * Get the fTopLinePunct field for the PAP record. - */ - public byte getFTopLinePunct() - { - return field_31_fTopLinePunct; - } - - /** - * Set the fTopLinePunct field for the PAP record. - */ - public void setFTopLinePunct(byte field_31_fTopLinePunct) - { - this.field_31_fTopLinePunct = field_31_fTopLinePunct; - } - - /** - * Get the fAutoSpaceDE field for the PAP record. - */ - public byte getFAutoSpaceDE() - { - return field_32_fAutoSpaceDE; - } - - /** - * Set the fAutoSpaceDE field for the PAP record. - */ - public void setFAutoSpaceDE(byte field_32_fAutoSpaceDE) - { - this.field_32_fAutoSpaceDE = field_32_fAutoSpaceDE; - } - - /** - * Get the fAutoSpaceDN field for the PAP record. - */ - public byte getFAutoSpaceDN() - { - return field_33_fAutoSpaceDN; - } - - /** - * Set the fAutoSpaceDN field for the PAP record. - */ - public void setFAutoSpaceDN(byte field_33_fAutoSpaceDN) - { - this.field_33_fAutoSpaceDN = field_33_fAutoSpaceDN; - } - - /** - * Get the wAlignFont field for the PAP record. - */ - public int getWAlignFont() - { - return field_34_wAlignFont; - } - - /** - * Set the wAlignFont field for the PAP record. - */ - public void setWAlignFont(int field_34_wAlignFont) - { - this.field_34_wAlignFont = field_34_wAlignFont; - } - - /** - * Get the fontAlign field for the PAP record. - */ - public short getFontAlign() - { - return field_35_fontAlign; - } - - /** - * Set the fontAlign field for the PAP record. - */ - public void setFontAlign(short field_35_fontAlign) - { - this.field_35_fontAlign = field_35_fontAlign; - } - - /** - * Get the fBackward field for the PAP record. - */ - public byte getFBackward() - { - return field_36_fBackward; - } - - /** - * Set the fBackward field for the PAP record. - */ - public void setFBackward(byte field_36_fBackward) - { - this.field_36_fBackward = field_36_fBackward; - } - - /** - * Get the fRotateFont field for the PAP record. - */ - public byte getFRotateFont() - { - return field_37_fRotateFont; - } - - /** - * Set the fRotateFont field for the PAP record. - */ - public void setFRotateFont(byte field_37_fRotateFont) - { - this.field_37_fRotateFont = field_37_fRotateFont; + this.field_13_dyaAfter = field_13_dyaAfter; } /** @@ -719,15 +600,31 @@ public abstract class PAPAbstractType implements HDFType { */ public byte getFInTable() { - return field_38_fInTable; + return field_14_fInTable; } /** * Set the fInTable field for the PAP record. */ - public void setFInTable(byte field_38_fInTable) + public void setFInTable(byte field_14_fInTable) { - this.field_38_fInTable = field_38_fInTable; + this.field_14_fInTable = field_14_fInTable; + } + + /** + * Get the finTableW97 field for the PAP record. + */ + public byte getFinTableW97() + { + return field_15_finTableW97; + } + + /** + * Set the finTableW97 field for the PAP record. + */ + public void setFinTableW97(byte field_15_finTableW97) + { + this.field_15_finTableW97 = field_15_finTableW97; } /** @@ -735,63 +632,15 @@ public abstract class PAPAbstractType implements HDFType { */ public byte getFTtp() { - return field_39_fTtp; + return field_16_fTtp; } /** * Set the fTtp field for the PAP record. */ - public void setFTtp(byte field_39_fTtp) + public void setFTtp(byte field_16_fTtp) { - this.field_39_fTtp = field_39_fTtp; - } - - /** - * Get the wr field for the PAP record. - */ - public byte getWr() - { - return field_40_wr; - } - - /** - * Set the wr field for the PAP record. - */ - public void setWr(byte field_40_wr) - { - this.field_40_wr = field_40_wr; - } - - /** - * Get the fLocked field for the PAP record. - */ - public byte getFLocked() - { - return field_41_fLocked; - } - - /** - * Set the fLocked field for the PAP record. - */ - public void setFLocked(byte field_41_fLocked) - { - this.field_41_fLocked = field_41_fLocked; - } - - /** - * Get the ptap field for the PAP record. - */ - public byte[] getPtap() - { - return field_42_ptap; - } - - /** - * Set the ptap field for the PAP record. - */ - public void setPtap(byte[] field_42_ptap) - { - this.field_42_ptap = field_42_ptap; + this.field_16_fTtp = field_16_fTtp; } /** @@ -799,15 +648,15 @@ public abstract class PAPAbstractType implements HDFType { */ public int getDxaAbs() { - return field_43_dxaAbs; + return field_17_dxaAbs; } /** * Set the dxaAbs field for the PAP record. */ - public void setDxaAbs(int field_43_dxaAbs) + public void setDxaAbs(int field_17_dxaAbs) { - this.field_43_dxaAbs = field_43_dxaAbs; + this.field_17_dxaAbs = field_17_dxaAbs; } /** @@ -815,15 +664,15 @@ public abstract class PAPAbstractType implements HDFType { */ public int getDyaAbs() { - return field_44_dyaAbs; + return field_18_dyaAbs; } /** * Set the dyaAbs field for the PAP record. */ - public void setDyaAbs(int field_44_dyaAbs) + public void setDyaAbs(int field_18_dyaAbs) { - this.field_44_dyaAbs = field_44_dyaAbs; + this.field_18_dyaAbs = field_18_dyaAbs; } /** @@ -831,143 +680,111 @@ public abstract class PAPAbstractType implements HDFType { */ public int getDxaWidth() { - return field_45_dxaWidth; + return field_19_dxaWidth; } /** * Set the dxaWidth field for the PAP record. */ - public void setDxaWidth(int field_45_dxaWidth) + public void setDxaWidth(int field_19_dxaWidth) { - this.field_45_dxaWidth = field_45_dxaWidth; + this.field_19_dxaWidth = field_19_dxaWidth; } /** - * Get the brcTop field for the PAP record. + * Get the fBrLnAbove field for the PAP record. */ - public BorderCode getBrcTop() + public byte getFBrLnAbove() { - return field_46_brcTop; + return field_20_fBrLnAbove; } /** - * Set the brcTop field for the PAP record. + * Set the fBrLnAbove field for the PAP record. */ - public void setBrcTop(BorderCode field_46_brcTop) + public void setFBrLnAbove(byte field_20_fBrLnAbove) { - this.field_46_brcTop = field_46_brcTop; + this.field_20_fBrLnAbove = field_20_fBrLnAbove; } /** - * Get the brcLeft field for the PAP record. + * Get the fBrLnBelow field for the PAP record. */ - public BorderCode getBrcLeft() + public byte getFBrLnBelow() { - return field_47_brcLeft; + return field_21_fBrLnBelow; } /** - * Set the brcLeft field for the PAP record. + * Set the fBrLnBelow field for the PAP record. */ - public void setBrcLeft(BorderCode field_47_brcLeft) + public void setFBrLnBelow(byte field_21_fBrLnBelow) { - this.field_47_brcLeft = field_47_brcLeft; + this.field_21_fBrLnBelow = field_21_fBrLnBelow; } /** - * Get the brcBottom field for the PAP record. + * Get the pcVert field for the PAP record. */ - public BorderCode getBrcBottom() + public byte getPcVert() { - return field_48_brcBottom; + return field_22_pcVert; } /** - * Set the brcBottom field for the PAP record. + * Set the pcVert field for the PAP record. */ - public void setBrcBottom(BorderCode field_48_brcBottom) + public void setPcVert(byte field_22_pcVert) { - this.field_48_brcBottom = field_48_brcBottom; + this.field_22_pcVert = field_22_pcVert; } /** - * Get the brcRight field for the PAP record. + * Get the pcHorz field for the PAP record. */ - public BorderCode getBrcRight() + public byte getPcHorz() { - return field_49_brcRight; + return field_23_pcHorz; } /** - * Set the brcRight field for the PAP record. + * Set the pcHorz field for the PAP record. */ - public void setBrcRight(BorderCode field_49_brcRight) + public void setPcHorz(byte field_23_pcHorz) { - this.field_49_brcRight = field_49_brcRight; + this.field_23_pcHorz = field_23_pcHorz; } /** - * Get the brcBetween field for the PAP record. + * Get the wr field for the PAP record. */ - public BorderCode getBrcBetween() + public byte getWr() { - return field_50_brcBetween; + return field_24_wr; } /** - * Set the brcBetween field for the PAP record. + * Set the wr field for the PAP record. */ - public void setBrcBetween(BorderCode field_50_brcBetween) + public void setWr(byte field_24_wr) { - this.field_50_brcBetween = field_50_brcBetween; + this.field_24_wr = field_24_wr; } /** - * Get the brcBar field for the PAP record. + * Get the fNoAutoHyph field for the PAP record. */ - public BorderCode getBrcBar() + public byte getFNoAutoHyph() { - return field_51_brcBar; + return field_25_fNoAutoHyph; } /** - * Set the brcBar field for the PAP record. + * Set the fNoAutoHyph field for the PAP record. */ - public void setBrcBar(BorderCode field_51_brcBar) + public void setFNoAutoHyph(byte field_25_fNoAutoHyph) { - this.field_51_brcBar = field_51_brcBar; - } - - /** - * Get the dxaFromText field for the PAP record. - */ - public int getDxaFromText() - { - return field_52_dxaFromText; - } - - /** - * Set the dxaFromText field for the PAP record. - */ - public void setDxaFromText(int field_52_dxaFromText) - { - this.field_52_dxaFromText = field_52_dxaFromText; - } - - /** - * Get the dyaFromText field for the PAP record. - */ - public int getDyaFromText() - { - return field_53_dyaFromText; - } - - /** - * Set the dyaFromText field for the PAP record. - */ - public void setDyaFromText(int field_53_dyaFromText) - { - this.field_53_dyaFromText = field_53_dyaFromText; + this.field_25_fNoAutoHyph = field_25_fNoAutoHyph; } /** @@ -975,15 +792,15 @@ public abstract class PAPAbstractType implements HDFType { */ public int getDyaHeight() { - return field_54_dyaHeight; + return field_26_dyaHeight; } /** * Set the dyaHeight field for the PAP record. */ - public void setDyaHeight(int field_54_dyaHeight) + public void setDyaHeight(int field_26_dyaHeight) { - this.field_54_dyaHeight = field_54_dyaHeight; + this.field_26_dyaHeight = field_26_dyaHeight; } /** @@ -991,31 +808,15 @@ public abstract class PAPAbstractType implements HDFType { */ public byte getFMinHeight() { - return field_55_fMinHeight; + return field_27_fMinHeight; } /** * Set the fMinHeight field for the PAP record. */ - public void setFMinHeight(byte field_55_fMinHeight) + public void setFMinHeight(byte field_27_fMinHeight) { - this.field_55_fMinHeight = field_55_fMinHeight; - } - - /** - * Get the shd field for the PAP record. - */ - public ShadingDescriptor getShd() - { - return field_56_shd; - } - - /** - * Set the shd field for the PAP record. - */ - public void setShd(ShadingDescriptor field_56_shd) - { - this.field_56_shd = field_56_shd; + this.field_27_fMinHeight = field_27_fMinHeight; } /** @@ -1023,15 +824,255 @@ public abstract class PAPAbstractType implements HDFType { */ public DropCapSpecifier getDcs() { - return field_57_dcs; + return field_28_dcs; } /** * Set the dcs field for the PAP record. */ - public void setDcs(DropCapSpecifier field_57_dcs) + public void setDcs(DropCapSpecifier field_28_dcs) { - this.field_57_dcs = field_57_dcs; + this.field_28_dcs = field_28_dcs; + } + + /** + * Get the dyaFromText field for the PAP record. + */ + public int getDyaFromText() + { + return field_29_dyaFromText; + } + + /** + * Set the dyaFromText field for the PAP record. + */ + public void setDyaFromText(int field_29_dyaFromText) + { + this.field_29_dyaFromText = field_29_dyaFromText; + } + + /** + * Get the dxaFromText field for the PAP record. + */ + public int getDxaFromText() + { + return field_30_dxaFromText; + } + + /** + * Set the dxaFromText field for the PAP record. + */ + public void setDxaFromText(int field_30_dxaFromText) + { + this.field_30_dxaFromText = field_30_dxaFromText; + } + + /** + * Get the fLocked field for the PAP record. + */ + public byte getFLocked() + { + return field_31_fLocked; + } + + /** + * Set the fLocked field for the PAP record. + */ + public void setFLocked(byte field_31_fLocked) + { + this.field_31_fLocked = field_31_fLocked; + } + + /** + * Get the fWidowControl field for the PAP record. + */ + public byte getFWidowControl() + { + return field_32_fWidowControl; + } + + /** + * Set the fWidowControl field for the PAP record. + */ + public void setFWidowControl(byte field_32_fWidowControl) + { + this.field_32_fWidowControl = field_32_fWidowControl; + } + + /** + * Get the fKinsoku field for the PAP record. + */ + public byte getFKinsoku() + { + return field_33_fKinsoku; + } + + /** + * Set the fKinsoku field for the PAP record. + */ + public void setFKinsoku(byte field_33_fKinsoku) + { + this.field_33_fKinsoku = field_33_fKinsoku; + } + + /** + * Get the fWordWrap field for the PAP record. + */ + public byte getFWordWrap() + { + return field_34_fWordWrap; + } + + /** + * Set the fWordWrap field for the PAP record. + */ + public void setFWordWrap(byte field_34_fWordWrap) + { + this.field_34_fWordWrap = field_34_fWordWrap; + } + + /** + * Get the fOverflowPunct field for the PAP record. + */ + public byte getFOverflowPunct() + { + return field_35_fOverflowPunct; + } + + /** + * Set the fOverflowPunct field for the PAP record. + */ + public void setFOverflowPunct(byte field_35_fOverflowPunct) + { + this.field_35_fOverflowPunct = field_35_fOverflowPunct; + } + + /** + * Get the fTopLinePunct field for the PAP record. + */ + public byte getFTopLinePunct() + { + return field_36_fTopLinePunct; + } + + /** + * Set the fTopLinePunct field for the PAP record. + */ + public void setFTopLinePunct(byte field_36_fTopLinePunct) + { + this.field_36_fTopLinePunct = field_36_fTopLinePunct; + } + + /** + * Get the fAutoSpaceDE field for the PAP record. + */ + public byte getFAutoSpaceDE() + { + return field_37_fAutoSpaceDE; + } + + /** + * Set the fAutoSpaceDE field for the PAP record. + */ + public void setFAutoSpaceDE(byte field_37_fAutoSpaceDE) + { + this.field_37_fAutoSpaceDE = field_37_fAutoSpaceDE; + } + + /** + * Get the fAutoSpaceDN field for the PAP record. + */ + public byte getFAutoSpaceDN() + { + return field_38_fAutoSpaceDN; + } + + /** + * Set the fAutoSpaceDN field for the PAP record. + */ + public void setFAutoSpaceDN(byte field_38_fAutoSpaceDN) + { + this.field_38_fAutoSpaceDN = field_38_fAutoSpaceDN; + } + + /** + * Get the wAlignFont field for the PAP record. + */ + public int getWAlignFont() + { + return field_39_wAlignFont; + } + + /** + * Set the wAlignFont field for the PAP record. + */ + public void setWAlignFont(int field_39_wAlignFont) + { + this.field_39_wAlignFont = field_39_wAlignFont; + } + + /** + * Get the fontAlign field for the PAP record. + */ + public short getFontAlign() + { + return field_40_fontAlign; + } + + /** + * Set the fontAlign field for the PAP record. + */ + public void setFontAlign(short field_40_fontAlign) + { + this.field_40_fontAlign = field_40_fontAlign; + } + + /** + * 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; } /** @@ -1039,15 +1080,31 @@ public abstract class PAPAbstractType implements HDFType { */ public byte getLvl() { - return field_58_lvl; + return field_44_lvl; } /** * Set the lvl field for the PAP record. */ - public void setLvl(byte field_58_lvl) + public void setLvl(byte field_44_lvl) { - this.field_58_lvl = field_58_lvl; + this.field_44_lvl = field_44_lvl; + } + + /** + * Get the fBiDi field for the PAP record. + */ + public byte getFBiDi() + { + return field_45_fBiDi; + } + + /** + * Set the fBiDi field for the PAP record. + */ + public void setFBiDi(byte field_45_fBiDi) + { + this.field_45_fBiDi = field_45_fBiDi; } /** @@ -1055,15 +1112,335 @@ public abstract class PAPAbstractType implements HDFType { */ public byte getFNumRMIns() { - return field_59_fNumRMIns; + return field_46_fNumRMIns; } /** * Set the fNumRMIns field for the PAP record. */ - public void setFNumRMIns(byte field_59_fNumRMIns) + public void setFNumRMIns(byte field_46_fNumRMIns) { - this.field_59_fNumRMIns = field_59_fNumRMIns; + this.field_46_fNumRMIns = field_46_fNumRMIns; + } + + /** + * Get the fCrLf field for the PAP record. + */ + public byte getFCrLf() + { + return field_47_fCrLf; + } + + /** + * Set the fCrLf field for the PAP record. + */ + public void setFCrLf(byte field_47_fCrLf) + { + this.field_47_fCrLf = field_47_fCrLf; + } + + /** + * Get the fUsePgsuSettings field for the PAP record. + */ + public byte getFUsePgsuSettings() + { + return field_48_fUsePgsuSettings; + } + + /** + * Set the fUsePgsuSettings field for the PAP record. + */ + public void setFUsePgsuSettings(byte field_48_fUsePgsuSettings) + { + this.field_48_fUsePgsuSettings = field_48_fUsePgsuSettings; + } + + /** + * Get the fAdjustRight field for the PAP record. + */ + public byte getFAdjustRight() + { + return field_49_fAdjustRight; + } + + /** + * Set the fAdjustRight field for the PAP record. + */ + public void setFAdjustRight(byte field_49_fAdjustRight) + { + this.field_49_fAdjustRight = field_49_fAdjustRight; + } + + /** + * Get the dxcRight field for the PAP record. + */ + public short getDxcRight() + { + return field_50_dxcRight; + } + + /** + * Set the dxcRight field for the PAP record. + */ + public void setDxcRight(short field_50_dxcRight) + { + this.field_50_dxcRight = field_50_dxcRight; + } + + /** + * Get the dxcLeft field for the PAP record. + */ + public short getDxcLeft() + { + return field_51_dxcLeft; + } + + /** + * Set the dxcLeft field for the PAP record. + */ + public void setDxcLeft(short field_51_dxcLeft) + { + this.field_51_dxcLeft = field_51_dxcLeft; + } + + /** + * Get the dxcLeft1 field for the PAP record. + */ + public short getDxcLeft1() + { + return field_52_dxcLeft1; + } + + /** + * Set the dxcLeft1 field for the PAP record. + */ + public void setDxcLeft1(short field_52_dxcLeft1) + { + this.field_52_dxcLeft1 = field_52_dxcLeft1; + } + + /** + * Get the fDyaBeforeAuto field for the PAP record. + */ + public byte getFDyaBeforeAuto() + { + return field_53_fDyaBeforeAuto; + } + + /** + * Set the fDyaBeforeAuto field for the PAP record. + */ + public void setFDyaBeforeAuto(byte field_53_fDyaBeforeAuto) + { + this.field_53_fDyaBeforeAuto = field_53_fDyaBeforeAuto; + } + + /** + * Get the fDyaAfterAuto field for the PAP record. + */ + public byte getFDyaAfterAuto() + { + return field_54_fDyaAfterAuto; + } + + /** + * Set the fDyaAfterAuto field for the PAP record. + */ + public void setFDyaAfterAuto(byte field_54_fDyaAfterAuto) + { + this.field_54_fDyaAfterAuto = field_54_fDyaAfterAuto; + } + + /** + * Get the dxaRight field for the PAP record. + */ + public int getDxaRight() + { + return field_55_dxaRight; + } + + /** + * Set the dxaRight field for the PAP record. + */ + public void setDxaRight(int field_55_dxaRight) + { + this.field_55_dxaRight = field_55_dxaRight; + } + + /** + * Get the dxaLeft field for the PAP record. + */ + public int getDxaLeft() + { + return field_56_dxaLeft; + } + + /** + * Set the dxaLeft field for the PAP record. + */ + public void setDxaLeft(int field_56_dxaLeft) + { + this.field_56_dxaLeft = field_56_dxaLeft; + } + + /** + * Get the dxaLeft1 field for the PAP record. + */ + public int getDxaLeft1() + { + return field_57_dxaLeft1; + } + + /** + * Set the dxaLeft1 field for the PAP record. + */ + public void setDxaLeft1(int field_57_dxaLeft1) + { + this.field_57_dxaLeft1 = field_57_dxaLeft1; + } + + /** + * Get the jc field for the PAP record. + */ + public byte getJc() + { + return field_58_jc; + } + + /** + * Set the jc field for the PAP record. + */ + public void setJc(byte field_58_jc) + { + this.field_58_jc = field_58_jc; + } + + /** + * Get the fNoAllowOverlap field for the PAP record. + */ + public byte getFNoAllowOverlap() + { + return field_59_fNoAllowOverlap; + } + + /** + * Set the fNoAllowOverlap field for the PAP record. + */ + public void setFNoAllowOverlap(byte field_59_fNoAllowOverlap) + { + this.field_59_fNoAllowOverlap = field_59_fNoAllowOverlap; + } + + /** + * Get the brcTop field for the PAP record. + */ + public BorderCode getBrcTop() + { + return field_60_brcTop; + } + + /** + * Set the brcTop field for the PAP record. + */ + public void setBrcTop(BorderCode field_60_brcTop) + { + this.field_60_brcTop = field_60_brcTop; + } + + /** + * Get the brcLeft field for the PAP record. + */ + public BorderCode getBrcLeft() + { + return field_61_brcLeft; + } + + /** + * Set the brcLeft field for the PAP record. + */ + public void setBrcLeft(BorderCode field_61_brcLeft) + { + this.field_61_brcLeft = field_61_brcLeft; + } + + /** + * Get the brcBottom field for the PAP record. + */ + public BorderCode getBrcBottom() + { + return field_62_brcBottom; + } + + /** + * Set the brcBottom field for the PAP record. + */ + public void setBrcBottom(BorderCode field_62_brcBottom) + { + this.field_62_brcBottom = field_62_brcBottom; + } + + /** + * Get the brcRight field for the PAP record. + */ + public BorderCode getBrcRight() + { + return field_63_brcRight; + } + + /** + * Set the brcRight field for the PAP record. + */ + public void setBrcRight(BorderCode field_63_brcRight) + { + this.field_63_brcRight = field_63_brcRight; + } + + /** + * Get the brcBetween field for the PAP record. + */ + public BorderCode getBrcBetween() + { + return field_64_brcBetween; + } + + /** + * Set the brcBetween field for the PAP record. + */ + public void setBrcBetween(BorderCode field_64_brcBetween) + { + this.field_64_brcBetween = field_64_brcBetween; + } + + /** + * Get the brcBar field for the PAP record. + */ + public BorderCode getBrcBar() + { + return field_65_brcBar; + } + + /** + * Set the brcBar field for the PAP record. + */ + public void setBrcBar(BorderCode field_65_brcBar) + { + this.field_65_brcBar = field_65_brcBar; + } + + /** + * Get the shd field for the PAP record. + */ + public ShadingDescriptor getShd() + { + return field_66_shd; + } + + /** + * Set the shd field for the PAP record. + */ + public void setShd(ShadingDescriptor field_66_shd) + { + this.field_66_shd = field_66_shd; } /** @@ -1071,15 +1448,31 @@ public abstract class PAPAbstractType implements HDFType { */ public byte[] getAnld() { - return field_60_anld; + return field_67_anld; } /** * Set the anld field for the PAP record. */ - public void setAnld(byte[] field_60_anld) + public void setAnld(byte[] field_67_anld) { - this.field_60_anld = field_60_anld; + this.field_67_anld = field_67_anld; + } + + /** + * Get the phe field for the PAP record. + */ + public byte[] getPhe() + { + return field_68_phe; + } + + /** + * Set the phe field for the PAP record. + */ + public void setPhe(byte[] field_68_phe) + { + this.field_68_phe = field_68_phe; } /** @@ -1087,15 +1480,15 @@ public abstract class PAPAbstractType implements HDFType { */ public int getFPropRMark() { - return field_61_fPropRMark; + return field_69_fPropRMark; } /** * Set the fPropRMark field for the PAP record. */ - public void setFPropRMark(int field_61_fPropRMark) + public void setFPropRMark(int field_69_fPropRMark) { - this.field_61_fPropRMark = field_61_fPropRMark; + this.field_69_fPropRMark = field_69_fPropRMark; } /** @@ -1103,15 +1496,15 @@ public abstract class PAPAbstractType implements HDFType { */ public int getIbstPropRMark() { - return field_62_ibstPropRMark; + return field_70_ibstPropRMark; } /** * Set the ibstPropRMark field for the PAP record. */ - public void setIbstPropRMark(int field_62_ibstPropRMark) + public void setIbstPropRMark(int field_70_ibstPropRMark) { - this.field_62_ibstPropRMark = field_62_ibstPropRMark; + this.field_70_ibstPropRMark = field_70_ibstPropRMark; } /** @@ -1119,31 +1512,15 @@ public abstract class PAPAbstractType implements HDFType { */ public DateAndTime getDttmPropRMark() { - return field_63_dttmPropRMark; + return field_71_dttmPropRMark; } /** * Set the dttmPropRMark field for the PAP record. */ - public void setDttmPropRMark(DateAndTime field_63_dttmPropRMark) + public void setDttmPropRMark(DateAndTime field_71_dttmPropRMark) { - this.field_63_dttmPropRMark = field_63_dttmPropRMark; - } - - /** - * Get the numrm field for the PAP record. - */ - public byte[] getNumrm() - { - return field_64_numrm; - } - - /** - * Set the numrm field for the PAP record. - */ - public void setNumrm(byte[] field_64_numrm) - { - this.field_64_numrm = field_64_numrm; + this.field_71_dttmPropRMark = field_71_dttmPropRMark; } /** @@ -1151,15 +1528,15 @@ public abstract class PAPAbstractType implements HDFType { */ public int getItbdMac() { - return field_65_itbdMac; + return field_72_itbdMac; } /** * Set the itbdMac field for the PAP record. */ - public void setItbdMac(int field_65_itbdMac) + public void setItbdMac(int field_72_itbdMac) { - this.field_65_itbdMac = field_65_itbdMac; + this.field_72_itbdMac = field_72_itbdMac; } /** @@ -1167,15 +1544,15 @@ public abstract class PAPAbstractType implements HDFType { */ public int[] getRgdxaTab() { - return field_66_rgdxaTab; + return field_73_rgdxaTab; } /** * Set the rgdxaTab field for the PAP record. */ - public void setRgdxaTab(int[] field_66_rgdxaTab) + public void setRgdxaTab(int[] field_73_rgdxaTab) { - this.field_66_rgdxaTab = field_66_rgdxaTab; + this.field_73_rgdxaTab = field_73_rgdxaTab; } /** @@ -1183,15 +1560,47 @@ public abstract class PAPAbstractType implements HDFType { */ public byte[] getRgtbd() { - return field_67_rgtbd; + return field_74_rgtbd; } /** * Set the rgtbd field for the PAP record. */ - public void setRgtbd(byte[] field_67_rgtbd) + public void setRgtbd(byte[] field_74_rgtbd) { - this.field_67_rgtbd = field_67_rgtbd; + this.field_74_rgtbd = field_74_rgtbd; + } + + /** + * Get the numrm field for the PAP record. + */ + public byte[] getNumrm() + { + return field_75_numrm; + } + + /** + * Set the numrm field for the PAP record. + */ + public void setNumrm(byte[] field_75_numrm) + { + this.field_75_numrm = field_75_numrm; + } + + /** + * Get the ptap field for the PAP record. + */ + public byte[] getPtap() + { + return field_76_ptap; + } + + /** + * Set the ptap field for the PAP record. + */ + public void setPtap(byte[] field_76_ptap) + { + this.field_76_ptap = field_76_ptap; } /** @@ -1199,15 +1608,15 @@ public abstract class PAPAbstractType implements HDFType { */ public byte getTableLevel() { - return field_68_tableLevel; + return field_77_tableLevel; } /** * Set the tableLevel field for the PAP record. */ - public void setTableLevel(byte field_68_tableLevel) + public void setTableLevel(byte field_77_tableLevel) { - this.field_68_tableLevel = field_68_tableLevel; + this.field_77_tableLevel = field_77_tableLevel; } /** @@ -1215,15 +1624,15 @@ public abstract class PAPAbstractType implements HDFType { */ public byte getFTtpEmbedded() { - return field_69_fTtpEmbedded; + return field_78_fTtpEmbedded; } /** * Set the fTtpEmbedded field for the PAP record. */ - public void setFTtpEmbedded(byte field_69_fTtpEmbedded) + public void setFTtpEmbedded(byte field_78_fTtpEmbedded) { - this.field_69_fTtpEmbedded = field_69_fTtpEmbedded; + this.field_78_fTtpEmbedded = field_78_fTtpEmbedded; } /** @@ -1231,78 +1640,78 @@ public abstract class PAPAbstractType implements HDFType { */ public byte getEmbeddedCellMark() { - return field_70_embeddedCellMark; + return field_79_embeddedCellMark; } /** * Set the embeddedCellMark field for the PAP record. */ - public void setEmbeddedCellMark(byte field_70_embeddedCellMark) + public void setEmbeddedCellMark(byte field_79_embeddedCellMark) { - this.field_70_embeddedCellMark = field_70_embeddedCellMark; + this.field_79_embeddedCellMark = field_79_embeddedCellMark; } /** * Sets the fVertical field value. - * + * */ public void setFVertical(boolean value) { - field_35_fontAlign = (short)fVertical.setBoolean(field_35_fontAlign, value); - + field_40_fontAlign = (short)fVertical.setBoolean(field_40_fontAlign, value); + } /** - * + * * @return the fVertical field value. */ public boolean isFVertical() { - return fVertical.isSet(field_35_fontAlign); - + return fVertical.isSet(field_40_fontAlign); + } /** * Sets the fBackward field value. - * + * */ public void setFBackward(boolean value) { - field_35_fontAlign = (short)fBackward.setBoolean(field_35_fontAlign, value); - + field_40_fontAlign = (short)fBackward.setBoolean(field_40_fontAlign, value); + } /** - * + * * @return the fBackward field value. */ public boolean isFBackward() { - return fBackward.isSet(field_35_fontAlign); - + return fBackward.isSet(field_40_fontAlign); + } /** * Sets the fRotateFont field value. - * + * */ public void setFRotateFont(boolean value) { - field_35_fontAlign = (short)fRotateFont.setBoolean(field_35_fontAlign, value); - + field_40_fontAlign = (short)fRotateFont.setBoolean(field_40_fontAlign, value); + } /** - * + * * @return the fRotateFont field value. */ public boolean isFRotateFont() { - return fRotateFont.isSet(field_35_fontAlign); - + return fRotateFont.isSet(field_40_fontAlign); + } 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 67af3ecca..59fbff392 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java @@ -34,13 +34,27 @@ public final class ParagraphSprmCompressor public static byte[] compressParagraphProperty(ParagraphProperties newPAP, ParagraphProperties oldPAP) { + // page numbers links to Word97-2007BinaryFileFormat(doc)Specification.pdf, accessible from microsoft.com + List sprmList = new ArrayList(); int size = 0; + // Page 50 of public specification begins + if (newPAP.getIstd() != oldPAP.getIstd()) + { + // sprmPIstd + size += SprmUtils.addSprm((short)0x4600, newPAP.getIstd(), null, sprmList); + } if (newPAP.getJc() != oldPAP.getJc()) { + // sprmPJc80 size += SprmUtils.addSprm((short)0x2403, newPAP.getJc(), null, sprmList); } + if (newPAP.getFSideBySide() != oldPAP.getFSideBySide()) + { + // sprmPFSideBySide + size += SprmUtils.addSprm((short)0x2404, newPAP.getFSideBySide(), null, sprmList); + } if (newPAP.getFKeep() != oldPAP.getFKeep()) { size += SprmUtils.addSprm((short)0x2405, newPAP.getFKeep(), null, sprmList); @@ -73,54 +87,63 @@ public final class ParagraphSprmCompressor { size += SprmUtils.addSprm((short)0x240C, newPAP.getFNoLnn(), null, sprmList); } - if (newPAP.getFSideBySide() != oldPAP.getFSideBySide()) - { - size += SprmUtils.addSprm((short)0x2404, newPAP.getFSideBySide(), null, sprmList); - } - if (newPAP.getFNoAutoHyph() != oldPAP.getFNoAutoHyph()) - { - size += SprmUtils.addSprm((short)0x242A, newPAP.getFNoAutoHyph(), null, sprmList); - } - if (newPAP.getFWidowControl() != oldPAP.getFWidowControl()) - { - size += SprmUtils.addSprm((short)0x2431, newPAP.getFWidowControl(), null, sprmList); - } if (newPAP.getItbdMac() != oldPAP.getItbdMac() || - !Arrays.equals(newPAP.getRgdxaTab(), oldPAP.getRgdxaTab()) || - !Arrays.equals(newPAP.getRgtbd(), oldPAP.getRgtbd())) - { - /** @todo revisit this */ -// byte[] oldTabArray = oldPAP.getRgdxaTab(); -// byte[] newTabArray = newPAP.getRgdxaTab(); -// byte[] newTabDescriptors = newPAP.getRgtbd(); -// byte[] varParam = new byte[2 + oldTabArray.length + newTabArray.length + -// newTabDescriptors.length]; -// varParam[0] = (byte)(oldTabArray.length/2); -// int offset = 1; -// System.arraycopy(oldTabArray, 0, varParam, offset, oldTabArray.length); -// offset += oldTabArray.length; -// varParam[offset] = (byte)(newTabArray.length/2); -// offset += 1; -// System.arraycopy(newTabArray, 0, varParam, offset, newTabArray.length); -// offset += newTabArray.length; -// System.arraycopy(newTabDescriptors, 0, varParam, offset, newTabDescriptors.length); -// -// size += SprmUtils.addSprm((short)0xC60D, 0, varParam, sprmList); - } - if (newPAP.getDxaRight() != oldPAP.getDxaRight()) - { - size += SprmUtils.addSprm((short)0x840E, newPAP.getDxaRight(), null, sprmList); + !Arrays.equals(newPAP.getRgdxaTab(), oldPAP.getRgdxaTab()) || + !Arrays.equals(newPAP.getRgtbd(), oldPAP.getRgtbd())) + { + /** @todo revisit this */ +// byte[] oldTabArray = oldPAP.getRgdxaTab(); +// byte[] newTabArray = newPAP.getRgdxaTab(); +// byte[] newTabDescriptors = newPAP.getRgtbd(); +// byte[] varParam = new byte[2 + oldTabArray.length + newTabArray.length + +// newTabDescriptors.length]; +// varParam[0] = (byte)(oldTabArray.length/2); +// int offset = 1; +// System.arraycopy(oldTabArray, 0, varParam, offset, oldTabArray.length); +// offset += oldTabArray.length; +// varParam[offset] = (byte)(newTabArray.length/2); +// offset += 1; +// System.arraycopy(newTabArray, 0, varParam, offset, newTabArray.length); +// offset += newTabArray.length; +// System.arraycopy(newTabDescriptors, 0, varParam, offset, newTabDescriptors.length); + // +// size += SprmUtils.addSprm((short)0xC60D, 0, varParam, sprmList); } if (newPAP.getDxaLeft() != oldPAP.getDxaLeft()) { + // sprmPDxaLeft80 size += SprmUtils.addSprm((short)0x840F, newPAP.getDxaLeft(), null, sprmList); } + + // Page 51 of public specification begins if (newPAP.getDxaLeft1() != oldPAP.getDxaLeft1()) { + // sprmPDxaLeft180 size += SprmUtils.addSprm((short)0x8411, newPAP.getDxaLeft1(), null, sprmList); } + if (newPAP.getDxaRight() != oldPAP.getDxaRight()) + { + // sprmPDxaRight80 + size += SprmUtils.addSprm((short)0x840E, newPAP.getDxaRight(), null, sprmList); + } + if (newPAP.getDxcLeft() != oldPAP.getDxcLeft()) + { + // sprmPDxcLeft + size += SprmUtils.addSprm((short)0x4456, newPAP.getDxcLeft(), null, sprmList); + } + if (newPAP.getDxcLeft1() != oldPAP.getDxcLeft1()) + { + // sprmPDxcLeft1 + size += SprmUtils.addSprm((short)0x4457, newPAP.getDxcLeft1(), null, sprmList); + } + if (newPAP.getDxcRight() != oldPAP.getDxcRight()) + { + // sprmPDxcRight + size += SprmUtils.addSprm((short)0x4455, newPAP.getDxcRight(), null, sprmList); + } if (!newPAP.getLspd().equals(oldPAP.getLspd())) { + // sprmPDyaLine byte[] buf = new byte[4]; newPAP.getLspd().serialize(buf, 0); @@ -128,15 +151,132 @@ public final class ParagraphSprmCompressor } if (newPAP.getDyaBefore() != oldPAP.getDyaBefore()) { + // sprmPDyaBefore size += SprmUtils.addSprm((short)0xA413, newPAP.getDyaBefore(), null, sprmList); } if (newPAP.getDyaAfter() != oldPAP.getDyaAfter()) { + // sprmPDyaAfter size += SprmUtils.addSprm((short)0xA414, newPAP.getDyaAfter(), null, sprmList); } - if (newPAP.getDyaBefore() != oldPAP.getDyaBefore()) + if (newPAP.getFDyaBeforeAuto() != oldPAP.getFDyaBeforeAuto()) { - size += SprmUtils.addSprm((short)0x2404, newPAP.getDyaBefore(), null, sprmList); + // sprmPFDyaBeforeAuto + size += SprmUtils.addSprm((short)0x245B, newPAP.getFDyaBeforeAuto(), null, sprmList); + } + if (newPAP.getFDyaAfterAuto() != oldPAP.getFDyaAfterAuto()) + { + // sprmPFDyaAfterAuto + size += SprmUtils.addSprm((short)0x245C, newPAP.getFDyaAfterAuto(), null, sprmList); + } + if (newPAP.getFInTable() != oldPAP.getFInTable()) + { + // sprmPFInTable + size += SprmUtils.addSprm((short)0x2416, newPAP.getFInTable(), null, sprmList); + } + if (newPAP.getFTtp() != oldPAP.getFTtp()) + { + // sprmPFTtp + size += SprmUtils.addSprm((short)0x2417, newPAP.getFTtp(), null, sprmList); + } + if (newPAP.getDxaAbs() != oldPAP.getDxaAbs()) + { + // sprmPDxaAbs + size += SprmUtils.addSprm((short)0x8418, newPAP.getDxaAbs(), null, sprmList); + } + if (newPAP.getDyaAbs() != oldPAP.getDyaAbs()) + { + // sprmPDyaAbs + size += SprmUtils.addSprm((short)0x8419, newPAP.getDyaAbs(), null, sprmList); + } + if (newPAP.getDxaWidth() != oldPAP.getDxaWidth()) + { + // sprmPDxaWidth + size += SprmUtils.addSprm((short)0x841A, newPAP.getDxaWidth(), null, sprmList); + } + + // Page 52 of public specification begins + if (newPAP.getWr() != oldPAP.getWr()) + { + size += SprmUtils.addSprm((short)0x2423, newPAP.getWr(), null, sprmList); + } + + if (newPAP.getBrcBar().equals(oldPAP.getBrcBar())) + { + // XXX: sprm code 0x6428 is sprmPBrcBetween80, but accessed property linked to sprmPBrcBar80 (0x6629) + int brc = newPAP.getBrcBar().toInt(); + size += SprmUtils.addSprm((short)0x6428, brc, null, sprmList); + } + if (!newPAP.getBrcBottom().equals(oldPAP.getBrcBottom())) + { + // sprmPBrcBottom80 + int brc = newPAP.getBrcBottom().toInt(); + size += SprmUtils.addSprm((short)0x6426, brc, null, sprmList); + } + if (!newPAP.getBrcLeft().equals(oldPAP.getBrcLeft())) + { + // sprmPBrcLeft80 + int brc = newPAP.getBrcLeft().toInt(); + size += SprmUtils.addSprm((short)0x6425, brc, null, sprmList); + } + + // Page 53 of public specification begins + if (!newPAP.getBrcRight().equals(oldPAP.getBrcRight())) + { + // sprmPBrcRight80 + int brc = newPAP.getBrcRight().toInt(); + size += SprmUtils.addSprm((short)0x6427, brc, null, sprmList); + } + if (!newPAP.getBrcTop().equals(oldPAP.getBrcTop())) + { + // sprmPBrcTop80 + int brc = newPAP.getBrcTop().toInt(); + size += SprmUtils.addSprm((short)0x6424, brc, null, sprmList); + } + if (newPAP.getFNoAutoHyph() != oldPAP.getFNoAutoHyph()) + { + size += SprmUtils.addSprm((short)0x242A, newPAP.getFNoAutoHyph(), null, sprmList); + } + if (newPAP.getDyaHeight() != oldPAP.getDyaHeight() || + newPAP.getFMinHeight() != oldPAP.getFMinHeight()) + { + // sprmPWHeightAbs + short val = (short)newPAP.getDyaHeight(); + if (newPAP.getFMinHeight() > 0) + { + val |= 0x8000; + } + size += SprmUtils.addSprm((short)0x442B, val, null, sprmList); + } + if (newPAP.getDcs() != null && !newPAP.getDcs().equals(oldPAP.getDcs())) + { + // sprmPDcs + size += SprmUtils.addSprm((short)0x442C, newPAP.getDcs().toShort(), null, sprmList); + } + if (newPAP.getShd() != null && !newPAP.getShd().equals(oldPAP.getShd())) + { + // sprmPShd80 + size += SprmUtils.addSprm((short)0x442D, newPAP.getShd().toShort(), null, sprmList); + } + if (newPAP.getDyaFromText() != oldPAP.getDyaFromText()) + { + // sprmPDyaFromText + size += SprmUtils.addSprm((short)0x842E, newPAP.getDyaFromText(), null, sprmList); + } + if (newPAP.getDxaFromText() != oldPAP.getDxaFromText()) + { + // sprmPDxaFromText + size += SprmUtils.addSprm((short)0x842F, newPAP.getDxaFromText(), null, sprmList); + } + if (newPAP.getFLocked() != oldPAP.getFLocked()) + { + // sprmPFLocked + size += SprmUtils.addSprm((short)0x2430, newPAP.getFLocked(), null, sprmList); + } + if (newPAP.getFWidowControl() != oldPAP.getFWidowControl()) + { + // sprmPFWidowControl + size += SprmUtils.addSprm((short)0x2431, newPAP.getFWidowControl(), null, sprmList); } if (newPAP.getFKinsoku() != oldPAP.getFKinsoku()) { @@ -166,6 +306,8 @@ public final class ParagraphSprmCompressor { size += SprmUtils.addSprm((short)0x4439, newPAP.getWAlignFont(), null, sprmList); } + + // Page 54 of public specification begins if (newPAP.isFBackward() != oldPAP.isFBackward() || newPAP.isFVertical() != oldPAP.isFVertical() || newPAP.isFRotateFont() != oldPAP.isFRotateFont()) @@ -187,125 +329,58 @@ public final class ParagraphSprmCompressor } if (!Arrays.equals(newPAP.getAnld(), oldPAP.getAnld())) { + // sprmPAnld80 size += SprmUtils.addSprm((short)0xC63E, 0, newPAP.getAnld(), sprmList); } - if (newPAP.getFInTable() != oldPAP.getFInTable()) - { - size += SprmUtils.addSprm((short)0x2416, newPAP.getFInTable(), null, sprmList); - } - if (newPAP.getFTtp() != oldPAP.getFTtp()) - { - size += SprmUtils.addSprm((short)0x2417, newPAP.getFTtp(), null, sprmList); - } - if (newPAP.getWr() != oldPAP.getWr()) - { - size += SprmUtils.addSprm((short)0x2423, newPAP.getWr(), null, sprmList); - } - if (newPAP.getFLocked() != oldPAP.getFLocked()) - { - size += SprmUtils.addSprm((short)0x2430, newPAP.getFLocked(), null, sprmList); - } - if (newPAP.getDxaAbs() != oldPAP.getDxaAbs()) - { - size += SprmUtils.addSprm((short)0x8418, newPAP.getDxaAbs(), null, sprmList); - } - if (newPAP.getDyaAbs() != oldPAP.getDyaAbs()) - { - size += SprmUtils.addSprm((short)0x8419, newPAP.getDyaAbs(), null, sprmList); - } - if (newPAP.getDxaWidth() != oldPAP.getDxaWidth()) - { - size += SprmUtils.addSprm((short)0x841A, newPAP.getDxaWidth(), null, sprmList); - } - if (!newPAP.getBrcTop().equals(oldPAP.getBrcTop())) - { - int brc = newPAP.getBrcTop().toInt(); - size += SprmUtils.addSprm((short)0x6424, brc, null, sprmList); - } - if (!newPAP.getBrcLeft().equals(oldPAP.getBrcLeft())) - { - int brc = newPAP.getBrcLeft().toInt(); - size += SprmUtils.addSprm((short)0x6425, brc, null, sprmList); - } - if (!newPAP.getBrcBottom().equals(oldPAP.getBrcBottom())) - { - int brc = newPAP.getBrcBottom().toInt(); - size += SprmUtils.addSprm((short)0x6426, brc, null, sprmList); - } - if (!newPAP.getBrcRight().equals(oldPAP.getBrcRight())) - { - int brc = newPAP.getBrcRight().toInt(); - size += SprmUtils.addSprm((short)0x6427, brc, null, sprmList); - } - if (newPAP.getBrcBar().equals(oldPAP.getBrcBar())) - { - int brc = newPAP.getBrcBar().toInt(); - size += SprmUtils.addSprm((short)0x6428, brc, null, sprmList); - } - if (newPAP.getDxaFromText() != oldPAP.getDxaFromText()) - { - size += SprmUtils.addSprm((short)0x842F, newPAP.getDxaFromText(), null, sprmList); - } - if (newPAP.getDyaFromText() != oldPAP.getDyaFromText()) - { - size += SprmUtils.addSprm((short)0x842E, newPAP.getDyaFromText(), null, sprmList); - } - if (newPAP.getDyaHeight() != oldPAP.getDyaHeight() || - newPAP.getFMinHeight() != oldPAP.getFMinHeight()) - { - short val = (short)newPAP.getDyaHeight(); - if (newPAP.getFMinHeight() > 0) - { - val |= 0x8000; - } - size += SprmUtils.addSprm((short)0x442B, val, null, sprmList); - } - if (newPAP.getShd() != null && !newPAP.getShd().equals(oldPAP.getShd())) - { - size += SprmUtils.addSprm((short)0x442D, newPAP.getShd().toShort(), null, sprmList); - } - if (newPAP.getDcs() != null && !newPAP.getDcs().equals(oldPAP.getDcs())) - { - size += SprmUtils.addSprm((short)0x442C, newPAP.getDcs().toShort(), null, sprmList); - } - if (newPAP.getLvl() != oldPAP.getLvl()) - { - size += SprmUtils.addSprm((short)0x2640, newPAP.getLvl(), null, sprmList); - } - if (newPAP.getFNumRMIns() != oldPAP.getFNumRMIns()) - { - size += SprmUtils.addSprm((short)0x2443, newPAP.getFNumRMIns(), null, sprmList); - } if (newPAP.getFPropRMark() != oldPAP.getFPropRMark() || - newPAP.getIbstPropRMark() != oldPAP.getIbstPropRMark() || - !newPAP.getDttmPropRMark().equals(oldPAP.getDttmPropRMark())) + newPAP.getIbstPropRMark() != oldPAP.getIbstPropRMark() || + !newPAP.getDttmPropRMark().equals(oldPAP.getDttmPropRMark())) { + // sprmPPropRMark byte[] buf = new byte[7]; buf[0] = (byte)newPAP.getFPropRMark(); LittleEndian.putShort(buf, 1, (short)newPAP.getIbstPropRMark()); newPAP.getDttmPropRMark().serialize(buf, 3); size += SprmUtils.addSprm((short)0xC63F, 0, buf, sprmList); } + if (newPAP.getLvl() != oldPAP.getLvl()) + { + // sprmPOutLvl + size += SprmUtils.addSprm((short)0x2640, newPAP.getLvl(), null, sprmList); + } + if (newPAP.getFBiDi() != oldPAP.getFBiDi()) + { + // sprmPFBiDi + size += SprmUtils.addSprm((short)0x2441, newPAP.getFBiDi(), null, sprmList); + } + if (newPAP.getFNumRMIns() != oldPAP.getFNumRMIns()) + { + // sprmPFNumRMIns + size += SprmUtils.addSprm((short)0x2443, newPAP.getFNumRMIns(), null, sprmList); + } if (!Arrays.equals(newPAP.getNumrm(), oldPAP.getNumrm())) { + // sprmPNumRM size += SprmUtils.addSprm((short)0xC645, 0, newPAP.getNumrm(), sprmList); } - - if (newPAP.getTableLevel() != oldPAP.getTableLevel()) - { - size += SprmUtils.addSprm((short)0x6649, newPAP.getTableLevel(), null, sprmList); - } - if (newPAP.getEmbeddedCellMark() != oldPAP.getEmbeddedCellMark()) { + // sprmPFInnerTableCell size += SprmUtils.addSprm((short)0x244b, newPAP.getEmbeddedCellMark(), null, sprmList); } - if (newPAP.getFTtpEmbedded() != oldPAP.getFTtpEmbedded()) { + // sprmPFInnerTtp size += SprmUtils.addSprm((short)0x244c, newPAP.getFTtpEmbedded(), null, sprmList); } + // Page 55 of public specification begins + if (newPAP.getTableLevel() != oldPAP.getTableLevel()) + { + // sprmPItap + size += SprmUtils.addSprm((short)0x6649, newPAP.getTableLevel(), null, sprmList); + } + return SprmUtils.getGrpprl(sprmList, size); } 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 695de5964..b4b322d4f 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java @@ -346,8 +346,7 @@ public final class ParagraphSprmUncompressor } break; case 0x41: - - // undocumented + // sprmPFBiDi break; case 0x43: @@ -387,7 +386,8 @@ public final class ParagraphSprmUncompressor newPAP.setFTtpEmbedded((byte)sprm.getOperand()); break; case 0x61: - // Logicial justification of the paragraph, eg left, centre, right + // sprmPJc + newPAP.setJustificationLogical((byte) sprm.getOperand()); break; default: break; 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 8ab3d904a..107ca463f 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java @@ -19,303 +19,272 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.hwpf.model.types.PAPAbstractType; -public final class ParagraphProperties extends PAPAbstractType implements Cloneable { +public final class ParagraphProperties extends PAPAbstractType implements + Cloneable { - public ParagraphProperties() - { - field_21_lspd = new LineSpacingDescriptor(); - field_24_phe = new byte[12]; - field_46_brcTop = new BorderCode(); - field_47_brcLeft = new BorderCode(); - field_48_brcBottom = new BorderCode(); - field_49_brcRight = new BorderCode(); - field_50_brcBetween = new BorderCode(); - field_51_brcBar = new BorderCode(); - field_60_anld = new byte[84]; - this.field_17_fWidowControl = 1; - this.field_21_lspd.setMultiLinespace((short)1); - this.field_21_lspd.setDyaLine((short)240); - this.field_58_lvl = (byte)9; - this.field_66_rgdxaTab = new int[0]; - this.field_67_rgtbd = new byte[0]; - this.field_63_dttmPropRMark = new DateAndTime(); + private boolean jcLogical = false; + + public ParagraphProperties() { + setLspd(new LineSpacingDescriptor()); + setPhe(new byte[12]); + setBrcTop(new BorderCode()); + setBrcLeft(new BorderCode()); + setBrcBottom(new BorderCode()); + setBrcRight(new BorderCode()); + setBrcBetween(new BorderCode()); + setBrcBar(new BorderCode()); + setAnld(new byte[84]); - } + 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 int getJustification() - { - return super.getJc(); - } + public int getJustification() { + if (jcLogical) { + if (getFBiDi() == 0) { + return getJc(); + } - public void setJustification(byte jc) - { - super.setJc(jc); - } + switch (getJc()) { + case 0: + return 2; + case 2: + return 0; + default: + return getJc(); + } + } - public boolean keepOnPage() - { - return super.getFKeep() != 0; - } + return getJc(); + } - public void setKeepOnPage(boolean fKeep) - { - super.setFKeep((byte)(fKeep ? 1 : 0)); - } + public void setJustification(byte jc) { + super.setJc(jc); + this.jcLogical = false; + } - public boolean keepWithNext() - { - return super.getFKeepFollow() != 0; - } + public void setJustificationLogical(byte jc) { + super.setJc(jc); + this.jcLogical = true; + } - public void setKeepWithNext(boolean fKeepFollow) - { - super.setFKeepFollow((byte)(fKeepFollow ? 1 : 0)); - } + public boolean keepOnPage() { + return super.getFKeep() != 0; + } - public boolean pageBreakBefore() - { - return super.getFPageBreakBefore() != 0; - } + public void setKeepOnPage(boolean fKeep) { + super.setFKeep((byte) (fKeep ? 1 : 0)); + } - public void setPageBreakBefore(boolean fPageBreak) - { - super.setFPageBreakBefore((byte)(fPageBreak ? 1 : 0)); - } + public boolean keepWithNext() { + return super.getFKeepFollow() != 0; + } - public boolean isLineNotNumbered() - { - return super.getFNoLnn() != 0; - } + public void setKeepWithNext(boolean fKeepFollow) { + super.setFKeepFollow((byte) (fKeepFollow ? 1 : 0)); + } - public void setLineNotNumbered(boolean fNoLnn) - { - super.setFNoLnn((byte)(fNoLnn ? 1 : 0)); - } + public boolean pageBreakBefore() { + return super.getFPageBreakBefore() != 0; + } - public boolean isSideBySide() - { - return super.getFSideBySide() != 0; - } + public void setPageBreakBefore(boolean fPageBreak) { + super.setFPageBreakBefore((byte) (fPageBreak ? 1 : 0)); + } - public void setSideBySide(boolean fSideBySide) - { - super.setFSideBySide((byte)(fSideBySide ? 1 : 0)); - } + public boolean isLineNotNumbered() { + return super.getFNoLnn() != 0; + } - public boolean isAutoHyphenated() - { - return super.getFNoAutoHyph() == 0; - } + public void setLineNotNumbered(boolean fNoLnn) { + super.setFNoLnn((byte) (fNoLnn ? 1 : 0)); + } - public void setAutoHyphenated(boolean auto) - { - super.setFNoAutoHyph((byte)(!auto ? 1 : 0)); - } + public boolean isSideBySide() { + return super.getFSideBySide() != 0; + } - public boolean isWidowControlled() - { - return super.getFWidowControl() != 0; - } + public void setSideBySide(boolean fSideBySide) { + super.setFSideBySide((byte) (fSideBySide ? 1 : 0)); + } - public void setWidowControl(boolean widowControl) - { - super.setFWidowControl((byte)(widowControl ? 1 : 0)); - } + public boolean isAutoHyphenated() { + return super.getFNoAutoHyph() == 0; + } - public int getIndentFromRight() - { - return super.getDxaRight(); - } + public void setAutoHyphenated(boolean auto) { + super.setFNoAutoHyph((byte) (!auto ? 1 : 0)); + } - public void setIndentFromRight(int dxaRight) - { - super.setDxaRight(dxaRight); - } + public boolean isWidowControlled() { + return super.getFWidowControl() != 0; + } - public int getIndentFromLeft() - { - return super.getDxaLeft(); - } + public void setWidowControl(boolean widowControl) { + super.setFWidowControl((byte) (widowControl ? 1 : 0)); + } - public void setIndentFromLeft(int dxaLeft) - { - super.setDxaLeft(dxaLeft); - } + public int getIndentFromRight() { + return super.getDxaRight(); + } - public int getFirstLineIndent() - { - return super.getDxaLeft1(); - } + public void setIndentFromRight(int dxaRight) { + super.setDxaRight(dxaRight); + } - public void setFirstLineIndent(int first) - { - super.setDxaLeft1(first); - } + public int getIndentFromLeft() { + return super.getDxaLeft(); + } - public LineSpacingDescriptor getLineSpacing() - { - return super.getLspd(); - } + public void setIndentFromLeft(int dxaLeft) { + super.setDxaLeft(dxaLeft); + } - public void setLineSpacing(LineSpacingDescriptor lspd) - { - super.setLspd(lspd); - } + public int getFirstLineIndent() { + return super.getDxaLeft1(); + } - public int getSpacingBefore() - { - return super.getDyaBefore(); - } + public void setFirstLineIndent(int first) { + super.setDxaLeft1(first); + } - public void setSpacingBefore(int before) - { - super.setDyaBefore(before); - } + public LineSpacingDescriptor getLineSpacing() { + return super.getLspd(); + } - public int getSpacingAfter() - { - return super.getDyaAfter(); - } + public void setLineSpacing(LineSpacingDescriptor lspd) { + super.setLspd(lspd); + } - public void setSpacingAfter(int after) - { - super.setDyaAfter(after); - } + public int getSpacingBefore() { + return super.getDyaBefore(); + } - public boolean isKinsoku() - { - return super.getFKinsoku() != 0; - } + public void setSpacingBefore(int before) { + super.setDyaBefore(before); + } - public void setKinsoku(boolean kinsoku) - { - super.setFKinsoku((byte)(kinsoku ? 1 : 0)); - } + public int getSpacingAfter() { + return super.getDyaAfter(); + } - public boolean isWordWrapped() - { - return super.getFWordWrap() != 0; - } + public void setSpacingAfter(int after) { + super.setDyaAfter(after); + } - public void setWordWrapped(boolean wrap) - { - super.setFWordWrap((byte)(wrap ? 1 : 0)); - } + public boolean isKinsoku() { + return super.getFKinsoku() != 0; + } - public int getFontAlignment() - { - return super.getWAlignFont(); - } + public void setKinsoku(boolean kinsoku) { + super.setFKinsoku((byte) (kinsoku ? 1 : 0)); + } - public void setFontAlignment(int align) - { - super.setWAlignFont(align); - } + public boolean isWordWrapped() { + return super.getFWordWrap() != 0; + } - public boolean isVertical() - { - return super.isFVertical(); - } + public void setWordWrapped(boolean wrap) { + super.setFWordWrap((byte) (wrap ? 1 : 0)); + } - public void setVertical(boolean vertical) - { - super.setFVertical(vertical); - } + public int getFontAlignment() { + return super.getWAlignFont(); + } - public boolean isBackward() - { - return super.isFBackward(); - } + public void setFontAlignment(int align) { + super.setWAlignFont(align); + } - public void setBackward(boolean bward) - { - super.setFBackward(bward); - } + public boolean isVertical() { + return super.isFVertical(); + } - public BorderCode getTopBorder() - { - return super.getBrcTop(); - } + public void setVertical(boolean vertical) { + super.setFVertical(vertical); + } - public void setTopBorder(BorderCode top) - { - super.setBrcTop(top); - } + public boolean isBackward() { + return super.isFBackward(); + } - public BorderCode getLeftBorder() - { - return super.getBrcLeft(); - } + public void setBackward(boolean bward) { + super.setFBackward(bward); + } - public void setLeftBorder(BorderCode left) - { - super.setBrcLeft(left); - } + public BorderCode getTopBorder() { + return super.getBrcTop(); + } - public BorderCode getBottomBorder() - { - return super.getBrcBottom(); - } + public void setTopBorder(BorderCode top) { + super.setBrcTop(top); + } - public void setBottomBorder(BorderCode bottom) - { - super.setBrcBottom(bottom); - } + public BorderCode getLeftBorder() { + return super.getBrcLeft(); + } - public BorderCode getRightBorder() - { - return super.getBrcRight(); - } + public void setLeftBorder(BorderCode left) { + super.setBrcLeft(left); + } - public void setRightBorder(BorderCode right) - { - super.setBrcRight(right); - } + public BorderCode getBottomBorder() { + return super.getBrcBottom(); + } - public BorderCode getBarBorder() - { - return super.getBrcBar(); - } + public void setBottomBorder(BorderCode bottom) { + super.setBrcBottom(bottom); + } - public void setBarBorder(BorderCode bar) - { - super.setBrcBar(bar); - } + public BorderCode getRightBorder() { + return super.getBrcRight(); + } - public ShadingDescriptor getShading() - { - return super.getShd(); - } + public void setRightBorder(BorderCode right) { + super.setBrcRight(right); + } - public void setShading(ShadingDescriptor shd) - { - super.setShd(shd); - } + public BorderCode getBarBorder() { + return super.getBrcBar(); + } - public DropCapSpecifier getDropCap() - { - return super.getDcs(); - } + public void setBarBorder(BorderCode bar) { + super.setBrcBar(bar); + } - public void setDropCap(DropCapSpecifier dcs) - { - super.setDcs(dcs); - } + public ShadingDescriptor getShading() { + return super.getShd(); + } - public Object clone() - throws CloneNotSupportedException - { - ParagraphProperties pp = (ParagraphProperties)super.clone(); - pp.field_21_lspd = (LineSpacingDescriptor)field_21_lspd.clone(); - pp.field_24_phe = field_24_phe.clone(); - pp.field_46_brcTop = (BorderCode)field_46_brcTop.clone(); - pp.field_47_brcLeft = (BorderCode)field_47_brcLeft.clone(); - pp.field_48_brcBottom = (BorderCode)field_48_brcBottom.clone(); - pp.field_49_brcRight = (BorderCode)field_49_brcRight.clone(); - pp.field_50_brcBetween = (BorderCode)field_50_brcBetween.clone(); - pp.field_51_brcBar = (BorderCode)field_51_brcBar.clone(); - pp.field_60_anld = field_60_anld.clone(); - return pp; - } + public void setShading(ShadingDescriptor shd) { + super.setShd(shd); + } + + public DropCapSpecifier getDropCap() { + return super.getDcs(); + } + + public void setDropCap(DropCapSpecifier dcs) { + super.setDcs(dcs); + } + + public Object clone() throws CloneNotSupportedException { + ParagraphProperties pp = (ParagraphProperties) super.clone(); + pp.setLspd((LineSpacingDescriptor) this.getLspd().clone()); + pp.setPhe(getPhe().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.setAnld(getAnld().clone()); + return pp; + } } diff --git a/src/types/definitions/pap_type.xml b/src/types/definitions/pap_type.xml index 0f26352f9..e83ccf670 100644 --- a/src/types/definitions/pap_type.xml +++ b/src/types/definitions/pap_type.xml @@ -23,33 +23,56 @@ Paragraph Properties. S. Ryan Ackley - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - @@ -62,38 +85,57 @@ + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + - - - + - + + + + +