You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by se...@apache.org on 2011/07/16 12:09:58 UTC
svn commit: r1147398 [2/2] - in /poi/trunk/src:
scratchpad/src/org/apache/poi/hwpf/model/types/
scratchpad/src/org/apache/poi/hwpf/sprm/
scratchpad/src/org/apache/poi/hwpf/usermodel/ types/definitions/
types/styles/
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java?rev=1147398&r1=1147397&r2=1147398&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java Sat Jul 16 10:09:57 2011
@@ -20,275 +20,315 @@ package org.apache.poi.hwpf.usermodel;
import org.apache.poi.hwpf.model.types.PAPAbstractType;
public final class ParagraphProperties extends PAPAbstractType implements
- Cloneable {
+ Cloneable
+{
private boolean jcLogical = false;
-
- public ParagraphProperties() {
- setAnld(new byte[84]);
- setBrcTop(new BorderCode());
- setBrcLeft(new BorderCode());
- setBrcBottom(new BorderCode());
- setBrcRight(new BorderCode());
- setBrcBetween(new BorderCode());
- setBrcBar(new BorderCode());
- setDcs( new DropCapSpecifier() );
- setLspd( new LineSpacingDescriptor() );
- setShd( new ShadingDescriptor() );
- setPhe( new byte[12] );
- setWidowControl(true);
- getLspd().setMultiLinespace((short) 1);
- getLspd().setDyaLine((short) 240);
- setLvl((byte) 9);
- setRgdxaTab(new int[0]);
- setRgtbd(new byte[0]);
- setDttmPropRMark(new DateAndTime());
+ public ParagraphProperties()
+ {
+ setAnld( new byte[84] );
+ setPhe( new byte[12] );
}
- public int getJustification() {
- if (jcLogical) {
- if (getFBiDi() == 0) {
- return getJc();
- }
-
- switch (getJc()) {
- case 0:
- return 2;
- case 2:
- return 0;
- default:
- return getJc();
- }
- }
-
- return getJc();
+ public Object clone() throws CloneNotSupportedException
+ {
+ ParagraphProperties pp = (ParagraphProperties) super.clone();
+ pp.setAnld( getAnld().clone() );
+ pp.setBrcTop( (BorderCode) getBrcTop().clone() );
+ pp.setBrcLeft( (BorderCode) getBrcLeft().clone() );
+ pp.setBrcBottom( (BorderCode) getBrcBottom().clone() );
+ pp.setBrcRight( (BorderCode) getBrcRight().clone() );
+ pp.setBrcBetween( (BorderCode) getBrcBetween().clone() );
+ pp.setBrcBar( (BorderCode) getBrcBar().clone() );
+ pp.setDcs( getDcs().clone() );
+ pp.setLspd( (LineSpacingDescriptor) getLspd().clone() );
+ pp.setShd( (ShadingDescriptor) getShd().clone() );
+ pp.setPhe( getPhe().clone() );
+ return pp;
}
- public void setJustification(byte jc) {
- super.setJc(jc);
- this.jcLogical = false;
+ public BorderCode getBarBorder()
+ {
+ return super.getBrcBar();
}
- public void setJustificationLogical(byte jc) {
- super.setJc(jc);
- this.jcLogical = true;
+ public BorderCode getBottomBorder()
+ {
+ return super.getBrcBottom();
}
- public boolean keepOnPage() {
- return super.getFKeep() != 0;
+ public DropCapSpecifier getDropCap()
+ {
+ return super.getDcs();
}
- public void setKeepOnPage(boolean fKeep) {
- super.setFKeep((byte) (fKeep ? 1 : 0));
+ public int getFirstLineIndent()
+ {
+ return super.getDxaLeft1();
}
- public boolean keepWithNext() {
- return super.getFKeepFollow() != 0;
+ public int getFontAlignment()
+ {
+ return super.getWAlignFont();
}
- public void setKeepWithNext(boolean fKeepFollow) {
- super.setFKeepFollow((byte) (fKeepFollow ? 1 : 0));
+ public int getIndentFromLeft()
+ {
+ return super.getDxaLeft();
}
- public boolean pageBreakBefore() {
- return super.getFPageBreakBefore() != 0;
+ public int getIndentFromRight()
+ {
+ return super.getDxaRight();
}
- public void setPageBreakBefore(boolean fPageBreak) {
- super.setFPageBreakBefore((byte) (fPageBreak ? 1 : 0));
+ public int getJustification()
+ {
+ if ( jcLogical )
+ {
+ if ( !getFBiDi() )
+ return getJc();
+
+ switch ( getJc() )
+ {
+ case 0:
+ return 2;
+ case 2:
+ return 0;
+ default:
+ return getJc();
+ }
+ }
+
+ return getJc();
}
- public boolean isLineNotNumbered() {
- return super.getFNoLnn() != 0;
+ public BorderCode getLeftBorder()
+ {
+ return super.getBrcLeft();
}
- public void setLineNotNumbered(boolean fNoLnn) {
- super.setFNoLnn((byte) (fNoLnn ? 1 : 0));
+ public LineSpacingDescriptor getLineSpacing()
+ {
+ return super.getLspd();
}
- public boolean isSideBySide() {
- return super.getFSideBySide() != 0;
+ public BorderCode getRightBorder()
+ {
+ return super.getBrcRight();
}
- public void setSideBySide(boolean fSideBySide) {
- super.setFSideBySide((byte) (fSideBySide ? 1 : 0));
+ public ShadingDescriptor getShading()
+ {
+ return super.getShd();
}
- public boolean isAutoHyphenated() {
- return super.getFNoAutoHyph() == 0;
+ public int getSpacingAfter()
+ {
+ return super.getDyaAfter();
}
- public void setAutoHyphenated(boolean auto) {
- super.setFNoAutoHyph((byte) (!auto ? 1 : 0));
+ public int getSpacingBefore()
+ {
+ return super.getDyaBefore();
}
- public boolean isWidowControlled() {
- return super.getFWidowControl() != 0;
+ public BorderCode getTopBorder()
+ {
+ return super.getBrcTop();
}
- public void setWidowControl(boolean widowControl) {
- super.setFWidowControl((byte) (widowControl ? 1 : 0));
+ public boolean isAutoHyphenated()
+ {
+ return !super.getFNoAutoHyph();
}
- public int getIndentFromRight() {
- return super.getDxaRight();
+ public boolean isBackward()
+ {
+ return super.isFBackward();
}
- public void setIndentFromRight(int dxaRight) {
- super.setDxaRight(dxaRight);
+ public boolean isKinsoku()
+ {
+ return super.getFKinsoku();
}
- public int getIndentFromLeft() {
- return super.getDxaLeft();
+ public boolean isLineNotNumbered()
+ {
+ return super.getFNoLnn();
}
- public void setIndentFromLeft(int dxaLeft) {
- super.setDxaLeft(dxaLeft);
+ public boolean isSideBySide()
+ {
+ return super.getFSideBySide();
}
- public int getFirstLineIndent() {
- return super.getDxaLeft1();
+ public boolean isVertical()
+ {
+ return super.isFVertical();
}
- public void setFirstLineIndent(int first) {
- super.setDxaLeft1(first);
+ public boolean isWidowControlled()
+ {
+ return super.getFWidowControl();
}
- public LineSpacingDescriptor getLineSpacing() {
- return super.getLspd();
+ public boolean isWordWrapped()
+ {
+ return super.getFWordWrap();
}
- public void setLineSpacing(LineSpacingDescriptor lspd) {
- super.setLspd(lspd);
+ public boolean keepOnPage()
+ {
+ return super.getFKeep();
}
- public int getSpacingBefore() {
- return super.getDyaBefore();
+ public boolean keepWithNext()
+ {
+ return super.getFKeepFollow();
}
- public void setSpacingBefore(int before) {
- super.setDyaBefore(before);
+ public boolean pageBreakBefore()
+ {
+ return super.getFPageBreakBefore();
}
- public int getSpacingAfter() {
- return super.getDyaAfter();
+ public void setAutoHyphenated( boolean auto )
+ {
+ super.setFNoAutoHyph( !auto );
}
- public void setSpacingAfter(int after) {
- super.setDyaAfter(after);
+ public void setBackward( boolean bward )
+ {
+ super.setFBackward( bward );
}
- public boolean isKinsoku() {
- return super.getFKinsoku() != 0;
+ public void setBarBorder( BorderCode bar )
+ {
+ super.setBrcBar( bar );
}
- public void setKinsoku(boolean kinsoku) {
- super.setFKinsoku((byte) (kinsoku ? 1 : 0));
+ public void setBottomBorder( BorderCode bottom )
+ {
+ super.setBrcBottom( bottom );
}
- public boolean isWordWrapped() {
- return super.getFWordWrap() != 0;
+ public void setDropCap( DropCapSpecifier dcs )
+ {
+ super.setDcs( dcs );
}
- public void setWordWrapped(boolean wrap) {
- super.setFWordWrap((byte) (wrap ? 1 : 0));
+ public void setFirstLineIndent( int first )
+ {
+ super.setDxaLeft1( first );
}
- public int getFontAlignment() {
- return super.getWAlignFont();
+ public void setFontAlignment( int align )
+ {
+ super.setWAlignFont( align );
}
- public void setFontAlignment(int align) {
- super.setWAlignFont(align);
+ public void setIndentFromLeft( int dxaLeft )
+ {
+ super.setDxaLeft( dxaLeft );
}
- public boolean isVertical() {
- return super.isFVertical();
+ public void setIndentFromRight( int dxaRight )
+ {
+ super.setDxaRight( dxaRight );
}
- public void setVertical(boolean vertical) {
- super.setFVertical(vertical);
+ public void setJustification( byte jc )
+ {
+ super.setJc( jc );
+ this.jcLogical = false;
}
- public boolean isBackward() {
- return super.isFBackward();
+ public void setJustificationLogical( byte jc )
+ {
+ super.setJc( jc );
+ this.jcLogical = true;
}
- public void setBackward(boolean bward) {
- super.setFBackward(bward);
+ public void setKeepOnPage( boolean fKeep )
+ {
+ super.setFKeep( fKeep );
}
- public BorderCode getTopBorder() {
- return super.getBrcTop();
+ public void setKeepWithNext( boolean fKeepFollow )
+ {
+ super.setFKeepFollow( fKeepFollow );
}
- public void setTopBorder(BorderCode top) {
- super.setBrcTop(top);
+ public void setKinsoku( boolean kinsoku )
+ {
+ super.setFKinsoku( kinsoku );
}
- public BorderCode getLeftBorder() {
- return super.getBrcLeft();
+ public void setLeftBorder( BorderCode left )
+ {
+ super.setBrcLeft( left );
}
- public void setLeftBorder(BorderCode left) {
- super.setBrcLeft(left);
+ public void setLineNotNumbered( boolean fNoLnn )
+ {
+ super.setFNoLnn( fNoLnn );
}
- public BorderCode getBottomBorder() {
- return super.getBrcBottom();
+ public void setLineSpacing( LineSpacingDescriptor lspd )
+ {
+ super.setLspd( lspd );
}
- public void setBottomBorder(BorderCode bottom) {
- super.setBrcBottom(bottom);
+ public void setPageBreakBefore( boolean fPageBreak )
+ {
+ super.setFPageBreakBefore( fPageBreak );
}
- public BorderCode getRightBorder() {
- return super.getBrcRight();
+ public void setRightBorder( BorderCode right )
+ {
+ super.setBrcRight( right );
}
- public void setRightBorder(BorderCode right) {
- super.setBrcRight(right);
+ public void setShading( ShadingDescriptor shd )
+ {
+ super.setShd( shd );
}
- public BorderCode getBarBorder() {
- return super.getBrcBar();
+ public void setSideBySide( boolean fSideBySide )
+ {
+ super.setFSideBySide( fSideBySide );
}
- public void setBarBorder(BorderCode bar) {
- super.setBrcBar(bar);
+ public void setSpacingAfter( int after )
+ {
+ super.setDyaAfter( after );
}
- public ShadingDescriptor getShading() {
- return super.getShd();
+ public void setSpacingBefore( int before )
+ {
+ super.setDyaBefore( before );
}
- public void setShading(ShadingDescriptor shd) {
- super.setShd(shd);
+ public void setTopBorder( BorderCode top )
+ {
+ super.setBrcTop( top );
}
- public DropCapSpecifier getDropCap() {
- return super.getDcs();
+ public void setVertical( boolean vertical )
+ {
+ super.setFVertical( vertical );
}
- public void setDropCap(DropCapSpecifier dcs) {
- super.setDcs(dcs);
+ public void setWidowControl( boolean widowControl )
+ {
+ super.setFWidowControl( widowControl );
}
- public Object clone() throws CloneNotSupportedException {
- ParagraphProperties pp = (ParagraphProperties) super.clone();
- pp.setAnld(getAnld().clone());
- pp.setBrcTop((BorderCode) getBrcTop().clone());
- pp.setBrcLeft((BorderCode) getBrcLeft().clone());
- pp.setBrcBottom((BorderCode) getBrcBottom().clone());
- pp.setBrcRight((BorderCode) getBrcRight().clone());
- pp.setBrcBetween((BorderCode) getBrcBetween().clone());
- pp.setBrcBar((BorderCode) getBrcBar().clone());
- pp.setDcs( getDcs().clone() );
- pp.setLspd( (LineSpacingDescriptor) getLspd().clone() );
- pp.setShd( (ShadingDescriptor) getShd().clone() );
- pp.setPhe( getPhe().clone() );
- return pp;
+ public void setWordWrapped( boolean wrap )
+ {
+ super.setFWordWrap( wrap );
}
}
Modified: poi/trunk/src/types/definitions/pap_type.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/types/definitions/pap_type.xml?rev=1147398&r1=1147397&r2=1147398&view=diff
==============================================================================
--- poi/trunk/src/types/definitions/pap_type.xml (original)
+++ poi/trunk/src/types/definitions/pap_type.xml Sat Jul 16 10:09:57 2011
@@ -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"/>
Modified: poi/trunk/src/types/styles/hdftype.xsl
URL: http://svn.apache.org/viewvc/poi/trunk/src/types/styles/hdftype.xsl?rev=1147398&r1=1147397&r2=1147398&view=diff
==============================================================================
--- poi/trunk/src/types/styles/hdftype.xsl (original)
+++ poi/trunk/src/types/styles/hdftype.xsl Sat Jul 16 10:09:57 2011
@@ -82,6 +82,33 @@ public abstract class </xsl:text><xsl:va
<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:va
<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="."/>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org