aboutsummaryrefslogtreecommitdiffstats
path: root/src/types
diff options
context:
space:
mode:
authorSergey Vladimirov <sergey@apache.org>2011-07-16 10:09:57 +0000
committerSergey Vladimirov <sergey@apache.org>2011-07-16 10:09:57 +0000
commit35046419e22695d6191cdeb0aa0bd500cbed7dc0 (patch)
tree3b076073e794467b2f8dd145e7ecacf5d1748b6c /src/types
parentbcf4530d36b24c356cd30b6404301f7e478171a0 (diff)
downloadpoi-35046419e22695d6191cdeb0aa0bd500cbed7dc0.tar.gz
poi-35046419e22695d6191cdeb0aa0bd500cbed7dc0.zip
update PAP definition
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1147398 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/types')
-rw-r--r--src/types/definitions/pap_type.xml101
-rw-r--r--src/types/styles/hdftype.xsl41
2 files changed, 97 insertions, 45 deletions
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 @@
<author>S. Ryan Ackley</author>
<fields>
<field type="int" size="2" name="istd" description="Index to style descriptor"/>
- <field type="byte" size="1" name="fSideBySide"/>
- <field type="byte" size="1" name="fKeep"/>
- <field type="byte" size="1" name="fKeepFollow"/>
- <field type="byte" size="1" name="fPageBreakBefore"/>
-
- <field type="byte" size="1" name="brcl" description="Border line style"/>
- <field type="byte" size="1" name="brcp" description="Rectangle border codes"/>
+ <field type="boolean" size="1" name="fSideBySide"/>
+ <field type="boolean" size="1" name="fKeep"/>
+ <field type="boolean" size="1" name="fKeepFollow"/>
+ <field type="boolean" size="1" name="fPageBreakBefore"/>
+
+ <field type="byte" size="1" name="brcl" description="Border line style">
+ <const type="byte" value="0" name="SINGLE"/>
+ <const type="byte" value="1" name="THICK"/>
+ <const type="byte" value="2" name="DOUBLE"/>
+ <const type="byte" value="3" name="SHADOW"/>
+ </field>
+ <field type="byte" size="1" name="brcp" description="Rectangle border codes">
+ <const type="byte" value="0" name="NONE"/>
+ <const type="byte" value="1" name="BORDER_ABOVE"/>
+ <const type="byte" value="2" name="BORDER_BELOW"/>
+ <const type="byte" value="15" name="BOX_AROUND"/>
+ <const type="byte" value="16" name="BAR_TO_LEFT_OF_PARAGRAPH"/>
+ </field>
<field type="byte" size="1" name="ilvl" description="List level if non-zero"/>
<!-- According to PAPX doc pointer is byte, but according to sprmPIlfo documentation pointer is short,
we will use int -->
<field type="int" size="2" name="ilfo" description="1-based index into the pllfo (lists structure), if non-zero"/>
- <field type="byte" size="1" name="fNoLnn" description="No line numbering"/>
+ <field type="boolean" size="1" name="fNoLnn" description="No line numbering"/>
- <field type="LineSpacingDescriptor" size="4" name="lspd" description="Line spacing descriptor"/>
+ <field type="LineSpacingDescriptor" size="4" default="new LineSpacingDescriptor()" name="lspd" description="Line spacing descriptor"/>
<field type="int" size="4" name="dyaBefore" description="Space before paragraph"/>
<field type="int" size="4" name="dyaAfter" description="Space after paragraph"/>
<!-- Not documented in PAP, but referenced by SPRM doc -->
- <field type="byte" size="1" name="fInTable" description="Paragraph is in table flag"/>
- <field type="byte" size="1" name="finTableW97" description="Archaic paragraph is in table flag"/>
- <field type="byte" size="1" name="fTtp" description="Table trailer paragraph (last in table row)"/>
+ <field type="boolean" size="1" name="fInTable" description="Paragraph is in table flag"/>
+ <field type="boolean" size="1" name="finTableW97" description="Archaic paragraph is in table flag"/>
+ <field type="boolean" size="1" name="fTtp" description="Table trailer paragraph (last in table row)"/>
<field type="int" size="4" name="dxaAbs"/>
<field type="int" size="4" name="dyaAbs"/>
<field type="int" size="4" name="dxaWidth"/>
- <field type="byte" size="1" name="fBrLnAbove"/>
- <field type="byte" size="1" name="fBrLnBelow"/>
+ <field type="boolean" size="1" name="fBrLnAbove"/>
+ <field type="boolean" size="1" name="fBrLnBelow"/>
<field type="byte" size="1" name="pcVert"/>
<field type="byte" size="1" name="pcHorz"/>
<field type="byte" size="1" name="wr"/>
- <field type="byte" size="1" name="fNoAutoHyph"/>
+ <field type="boolean" size="1" name="fNoAutoHyph"/>
<!-- wHeightAbs? -->
<field type="int" size="2" name="dyaHeight"/>
- <field type="byte" size="1" name="fMinHeight"/>
+ <field type="boolean" size="1" name="fMinHeight" description="Minimum height is exact or auto">
+ <const type="boolean" value="false" name="EXACT"/>
+ <const type="boolean" value="true" name="AT_LEAST"/>
+ </field>
<field type="DropCapSpecifier" size="2" name="dcs"/>
<field type="int" size="4" name="dyaFromText" description="Vertical distance between text and absolutely positioned object"/>
<field type="int" size="4" name="dxaFromText" description="Horizontal distance between text and absolutely positioned object"/>
- <field type="byte" size="1" name="fLocked"/>
- <field type="byte" size="1" name="fWidowControl"/>
- <field type="byte" size="1" name="fKinsoku"/>
- <field type="byte" size="1" name="fWordWrap"/>
- <field type="byte" size="1" name="fOverflowPunct"/>
- <field type="byte" size="1" name="fTopLinePunct"/>
- <field type="byte" size="1" name="fAutoSpaceDE"/>
- <field type="byte" size="1" name="fAutoSpaceDN"/>
- <field type="int" size="2" name="wAlignFont"/>
- <field type="short" size="2" name="fontAlign">
+ <field type="boolean" size="1" name="fLocked" description="Anchor of an absolutely positioned frame is locked"/>
+ <field type="boolean" size="1" default="true" name="fWidowControl" description="1, Word will prevent widowed lines in this paragraph from being placed at the beginning of a page"/>
+ <field type="boolean" size="1" name="fKinsoku" description="apply Kinsoku rules when performing line wrapping"/>
+ <field type="boolean" size="1" name="fWordWrap" description="perform word wrap"/>
+ <field type="boolean" size="1" name="fOverflowPunct" description="apply overflow punctuation rules when performing line wrapping"/>
+ <field type="boolean" size="1" name="fTopLinePunct" description="perform top line punctuation processing"/>
+ <field type="boolean" size="1" name="fAutoSpaceDE" description="auto space East Asian and alphabetic characters"/>
+ <field type="boolean" size="1" name="fAutoSpaceDN" description="auto space East Asian and numeric characters"/>
+ <field type="int" size="2" name="wAlignFont">
+ <const type="byte" value="0" name="HANGING"/>
+ <const type="byte" value="1" name="CENTERED"/>
+ <const type="byte" value="2" name="ROMAN"/>
+ <const type="byte" value="3" name="VARIABLE"/>
+ <const type="byte" value="4" name="AUTO"/>
+ </field>
+ <field type="short" size="2" name="fontAlign" description="Used internally by Word">
<bit number="0" mask="0x0001" name="fVertical"/>
<bit number="1" mask="0x0002" name="fBackward"/>
<bit number="2" mask="0x0004" name="fRotateFont"/>
</field>
- <field type="byte" size="1" name="fVertical"/>
- <field type="byte" size="1" name="fBackward"/>
- <field type="byte" size="1" name="fRotateFont"/>
- <field type="byte" size="1" name="lvl"/>
- <field type="byte" size="1" name="fBiDi"/>
- <field type="byte" size="1" name="fNumRMIns"/>
- <field type="byte" size="1" name="fCrLf"/>
- <field type="byte" size="1" name="fUsePgsuSettings"/>
- <field type="byte" size="1" name="fAdjustRight"/>
+ <field type="byte" size="1" default="9" name="lvl" description="Outline level"/>
+ <field type="boolean" size="1" name="fBiDi"/>
+ <field type="boolean" size="1" name="fNumRMIns"/>
+ <field type="boolean" size="1" name="fCrLf"/>
+ <field type="boolean" size="1" name="fUsePgsuSettings"/>
+ <field type="boolean" size="1" name="fAdjustRight"/>
<field type="int" size="4" name="itap" description="Table nesting level"/>
- <field type="byte" size="1" name="fInnerTableCell" description="When 1, the end of paragraph mark is really an end of cell mark for a nested table cell"/>
- <field type="byte" size="1" name="fOpenTch" description="Ensure the Table Cell char doesn't show up as zero height"/>
+ <field type="boolean" size="1" name="fInnerTableCell" description="When 1, the end of paragraph mark is really an end of cell mark for a nested table cell"/>
+ <field type="boolean" size="1" name="fOpenTch" description="Ensure the Table Cell char doesn't show up as zero height"/>
<!-- not part of properties structure, but used anyway. See sprmPFInnerTtp doc. -->
- <field type="byte" size="1" name="fTtpEmbedded" description="Word 97 compatibility indicates this end of paragraph mark is really an end of row marker for a nested table"/>
+ <field type="boolean" size="1" name="fTtpEmbedded" description="Word 97 compatibility indicates this end of paragraph mark is really an end of row marker for a nested table"/>
<field type="short" size="2" name="dxcRight" description="Right indent in character units"/>
<field type="short" size="2" name="dxcLeft" description="Left indent in character units"/>
<field type="short" size="2" name="dxcLeft1" description="First line indent in character units"/>
- <field type="byte" size="1" name="fDyaBeforeAuto" description="Vertical spacing before is automatic"/>
- <field type="byte" size="1" name="fDyaAfterAuto" description="Vertical spacing after is automatic"/>
+ <field type="boolean" size="1" name="fDyaBeforeAuto" description="Vertical spacing before is automatic"/>
+ <field type="boolean" size="1" name="fDyaAfterAuto" description="Vertical spacing after is automatic"/>
<field type="int" size="4" name="dxaRight"/>
<field type="int" size="4" name="dxaLeft"/>
@@ -115,7 +132,7 @@
<field type="byte" size="1" name="jc"/>
- <field type="byte" size="1" name="fNoAllowOverlap"/>
+ <field type="boolean" size="1" name="fNoAllowOverlap"/>
<field type="BorderCode" size="4" name="brcTop"/>
<field type="BorderCode" size="4" name="brcLeft"/>
@@ -127,7 +144,7 @@
<field type="ShadingDescriptor" size="2" name="shd"/>
<field type="byte[]" size="84" name="anld"/>
<field type="byte[]" size="12" name="phe"/>
- <field type="int" size="1" name="fPropRMark"/>
+ <field type="boolean" size="1" name="fPropRMark"/>
<field type="int" size="2" name="ibstPropRMark"/>
<field type="DateAndTime" size="4" name="dttmPropRMark"/>
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 </xsl:text><xsl:value-of select="@name"/><xsl:text>Abstrac
<xsl:text>;</xsl:text>
<xsl:call-template name="linebreak"/>
</xsl:if>
+ <xsl:choose>
+ <xsl:when test="@type='boolean'"/>
+ <xsl:when test="@type='byte'"/>
+ <xsl:when test="@type='int'"/>
+ <xsl:when test="@type='short'"/>
+ <xsl:when test="@type='long'"/>
+ <xsl:when test="substring(@type, string-length(@type) - 1) = '[]'">
+ <xsl:call-template name="indent"/>
+ <xsl:call-template name="indent"/>
+ <xsl:text>this.</xsl:text>
+ <xsl:value-of select="recutil:getFieldName(position(),@name,0)"/>
+ <xsl:text> = new </xsl:text>
+ <xsl:value-of select="substring(@type, 0, string-length(@type) - 1)"/>
+ <xsl:text>[0];</xsl:text>
+ <xsl:call-template name="linebreak"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="indent"/>
+ <xsl:call-template name="indent"/>
+ <xsl:text>this.</xsl:text>
+ <xsl:value-of select="recutil:getFieldName(position(),@name,0)"/>
+ <xsl:text> = new </xsl:text>
+ <xsl:value-of select="@type"/>
+ <xsl:text>();</xsl:text>
+ <xsl:call-template name="linebreak"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:for-each>
<xsl:call-template name="indent"/>
<xsl:text>}</xsl:text>
@@ -275,12 +302,20 @@ public abstract class </xsl:text><xsl:value-of select="@name"/><xsl:text>Abstrac
<xsl:text>builder.append(" (").append(get</xsl:text>
<xsl:value-of select="recutil:getFieldName1stCap(@name,0)"/>
<xsl:text>()).append(" )\n");</xsl:text>
- <xsl:apply-templates select="bit" mode="bittostring"/>
<xsl:call-template name="linebreak"/>
+ <xsl:apply-templates select="bit" mode="bittostring"/>
</xsl:template>
-<xsl:template match="bit" mode="bittostring"> buffer.append(" .<xsl:value-of select="recutil:getFieldName(@name,20)"/> = ").append(<xsl:value-of select="recutil:getBitFieldFunction(@name, @mask, ../@type, 'false')"/>()).append('\n');
-</xsl:template>
+ <xsl:template match="bit" mode="bittostring">
+ <xsl:call-template name="indent"/>
+ <xsl:call-template name="indent"/>
+ <xsl:text>builder.append(" .</xsl:text>
+ <xsl:value-of select="recutil:getFieldName(@name,20)"/>
+ <xsl:text> = ").append(</xsl:text>
+ <xsl:value-of select="recutil:getBitFieldFunction(@name, @mask, ../@type, 'false')"/>
+ <xsl:text>()).append('\n');</xsl:text>
+ <xsl:call-template name="linebreak"/>
+ </xsl:template>
<xsl:template match="author">
* @author <xsl:value-of select="."/>