diff options
author | Sergey Vladimirov <sergey@apache.org> | 2012-11-05 12:03:37 +0000 |
---|---|---|
committer | Sergey Vladimirov <sergey@apache.org> | 2012-11-05 12:03:37 +0000 |
commit | 23c804c734302615a17484227d976d1a342c4de6 (patch) | |
tree | 1f45d1231f56206a6cd7f4fa978236a0f81f2551 /src/types | |
parent | 0b09ea8b0d247f8547758a79e827f73f5de783ac (diff) | |
download | poi-23c804c734302615a17484227d976d1a342c4de6.tar.gz poi-23c804c734302615a17484227d976d1a342c4de6.zip |
update CHP type definition (all flags from grpfChp are supported now)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1405760 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/types')
-rw-r--r-- | src/types/definitions/chp_type.xml | 26 | ||||
-rw-r--r-- | src/types/styles/hdftype.xsl | 76 |
2 files changed, 70 insertions, 32 deletions
diff --git a/src/types/definitions/chp_type.xml b/src/types/definitions/chp_type.xml index 4c797d5314..5d77786e1d 100644 --- a/src/types/definitions/chp_type.xml +++ b/src/types/definitions/chp_type.xml @@ -57,19 +57,23 @@ <!-- Microsoft Office Word 97-2007 Binary File Format (.doc) Specification --> <!-- Page 103 of 210 --> - <bit number="21" mask="0x00200000" name="fComplexScripts" + <bit number="21" mask="0x00100000" name="fComplexScripts" description="Complex Scripts text that requires special processing to display and process"/> - <bit number="22" mask="0x00400000" name="fItalicBi" description="Complex Scripts text is italics"/> - <bit number="23" mask="0x00800000" name="fBiDi" + <bit number="22" mask="0x00200000" name="fItalicBi" description="Complex Scripts text is italics"/> + <bit number="23" mask="0x00400000" name="fBiDi" description="Complex Scripts right-to-left text that requires special processing to display and process (character reordering; contextual shaping; display of combining characters and diacritics; specialized justification rules; cursor positioning)"/> - <!-- fIcoBi --> - <!-- fNonGlyph --> - <!-- fBoldOther --> - <!-- fItalicOther --> - <!-- fNoProof --> - <!-- fWebHidden --> - <!-- fFitText --> - <!-- fCalc --> + + <bit number="24" mask="0x00800000" name="fIcoBi" description="Used internally by Word"/> + <bit number="25" mask="0x01000000" name="fNonGlyph" description="Used internally by Word"/> + <bit number="25" mask="0x02000000" name="fBoldOther" description="Used internally by Word 97 and earlier versions"/> + <bit number="26" mask="0x04000000" name="fItalicOther" description="Used internally by Word 97 and earlier versions"/> + + <bit number="27" mask="0x08000000" name="fNoProof" description="When set to 1, do not check spelling or grammar"/> + <bit number="28" mask="0x10000000" name="fWebHidden" description="Text should be hidden in Web View when set to 1"/> + <bit number="29" mask="0x20000000" name="fFitText" description="Fit text when set to 1"/> + + <bit number="30" mask="0x40000000" name="fCalc" description="Used internally by Word"/> + <bit number="31" mask="0x80000000" name="fFmtLineProp" description="Used internally by Word"/> </field> <field type="int" size="2" name="hps" default="20" description="Font size in half points"/> <field type="int" size="2" name="ftcAscii" description="Font for ASCII text"/> diff --git a/src/types/styles/hdftype.xsl b/src/types/styles/hdftype.xsl index a93d22d875..027323dfe0 100644 --- a/src/types/styles/hdftype.xsl +++ b/src/types/styles/hdftype.xsl @@ -30,7 +30,24 @@ <xsl:value-of select="/record/suffix"/> </xsl:template> -<xsl:template match="record"> + <xsl:template match="record"> + <xsl:text>/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ +</xsl:text> <xsl:if test="@package"> package <xsl:value-of select="@package"/>; @@ -243,7 +260,20 @@ public abstract class </xsl:text><xsl:call-template name="outputClassName"/><xsl <xsl:text>return false;</xsl:text> <xsl:call-template name="linebreak"/> </xsl:when> - <xsl:when test="@type='Grfhic'"> + <xsl:when test="@type='boolean' or @type='byte' or @type='double' or @type='int' or @type='long' or @type='short'"> + <xsl:text>if ( </xsl:text> + <xsl:value-of select="$fieldName"/> + <xsl:text> != other.</xsl:text> + <xsl:value-of select="$fieldName"/> + <xsl:text> )</xsl:text> + <xsl:call-template name="linebreak"/> + <xsl:call-template name="indent"/> + <xsl:call-template name="indent"/> + <xsl:call-template name="indent"/> + <xsl:text>return false;</xsl:text> + <xsl:call-template name="linebreak"/> + </xsl:when> + <xsl:otherwise> <xsl:text>if ( </xsl:text> <xsl:value-of select="$fieldName"/> <xsl:text> == null )</xsl:text> @@ -282,19 +312,6 @@ public abstract class </xsl:text><xsl:call-template name="outputClassName"/><xsl <xsl:call-template name="indent"/> <xsl:text>return false;</xsl:text> <xsl:call-template name="linebreak"/> - </xsl:when> - <xsl:otherwise> - <xsl:text>if ( </xsl:text> - <xsl:value-of select="$fieldName"/> - <xsl:text> != other.</xsl:text> - <xsl:value-of select="$fieldName"/> - <xsl:text> )</xsl:text> - <xsl:call-template name="linebreak"/> - <xsl:call-template name="indent"/> - <xsl:call-template name="indent"/> - <xsl:call-template name="indent"/> - <xsl:text>return false;</xsl:text> - <xsl:call-template name="linebreak"/> </xsl:otherwise> </xsl:choose> </xsl:for-each> @@ -320,19 +337,36 @@ public abstract class </xsl:text><xsl:call-template name="outputClassName"/><xsl <xsl:for-each select="//fields/field"> <xsl:call-template name="indent"/> <xsl:call-template name="indent"/> - <xsl:text>result = prime * result + </xsl:text> + <xsl:text>result = prime * result</xsl:text> + <xsl:variable name="fieldName" select="recutil:getFieldName(position(),@name,0)" /> <xsl:choose> <xsl:when test="substring(@type, string-length(@type)-1)='[]'"> + <xsl:text> + </xsl:text> <xsl:text>Arrays.hashCode( </xsl:text> - <xsl:value-of select="recutil:getFieldName(position(),@name,0)"/> + <xsl:value-of select="$fieldName"/> <xsl:text> )</xsl:text> </xsl:when> - <xsl:when test="@type='Grfhic'"> - <xsl:value-of select="recutil:getFieldName(position(),@name,0)"/> - <xsl:text>.hashCode()</xsl:text> + <xsl:when test="@type='boolean'"> + <xsl:text> + </xsl:text> + <xsl:text>( </xsl:text> + <xsl:value-of select="$fieldName"/> + <xsl:text>? 1231 : 1237 )</xsl:text> + </xsl:when> + <xsl:when test="@type='byte' or @type='double' or @type='int' or @type='long' or @type='short'"> + <xsl:text> + </xsl:text> + <xsl:value-of select="$fieldName"/> </xsl:when> <xsl:otherwise> - <xsl:value-of select="recutil:getFieldName(position(),@name,0)"/> + <xsl:call-template name="linebreak" /> + <xsl:call-template name="indent" /> + <xsl:call-template name="indent" /> + <xsl:call-template name="indent" /> + <xsl:call-template name="indent" /> + <xsl:text>+ ((</xsl:text> + <xsl:value-of select="$fieldName" /> + <xsl:text> == null) ? 0 : </xsl:text> + <xsl:value-of select="$fieldName" /> + <xsl:text>.hashCode())</xsl:text> </xsl:otherwise> </xsl:choose> <xsl:text>;</xsl:text> |