aboutsummaryrefslogtreecommitdiffstats
path: root/src/types
diff options
context:
space:
mode:
authorSergey Vladimirov <sergey@apache.org>2011-10-29 23:01:54 +0000
committerSergey Vladimirov <sergey@apache.org>2011-10-29 23:01:54 +0000
commit54b32f01e54ae26e75ed88c067b0b570764949f3 (patch)
treee93697be401e3f5a7ddd312b715b12c8a02ef758 /src/types
parentbf3550b406b8888a74b352a812ce63d88721a971 (diff)
downloadpoi-54b32f01e54ae26e75ed88c067b0b570764949f3.tar.gz
poi-54b32f01e54ae26e75ed88c067b0b570764949f3.zip
update list types definitions using new Grfhic class
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1195068 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/types')
-rw-r--r--src/types/definitions/grfhic_type.xml46
-rw-r--r--src/types/definitions/lfo_type.xml14
-rw-r--r--src/types/definitions/lstf_type.xml2
-rw-r--r--src/types/definitions/lvlf_type.xml2
-rw-r--r--src/types/styles/hdftype.xsl68
5 files changed, 109 insertions, 23 deletions
diff --git a/src/types/definitions/grfhic_type.xml b/src/types/definitions/grfhic_type.xml
new file mode 100644
index 0000000000..0c1cf5c7c5
--- /dev/null
+++ b/src/types/definitions/grfhic_type.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<!--
+ ====================================================================
+ 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.
+ ====================================================================
+-->
+<record fromfile="true" name="Grfhic" package="org.apache.poi.hwpf.model.types">
+ <suffix>AbstractType</suffix>
+ <description>The grfhic structure is a set of HTML incompatibility flags that specify the HTML
+ incompatibilities of a list structure. The values specify possible incompatibilities between
+ an LVL or LVLF and HTML lists. The values do not define list properties. &lt;p&gt;Class and
+ fields descriptions are quoted from [MS-DOC] -- v20110315 Word (.doc) Binary File Format
+ specification
+ </description>
+ <author>Sergey Vladimirov; according to [MS-DOC] -- v20110315 Word (.doc) Binary File Format
+ specification
+ </author>
+ <fields>
+ <field type="byte" size="1" name="grfhic" description="HTML compatibility flags">
+ <bit number="0" mask="0x01" name="fHtmlChecked" description="Checked"/>
+ <bit number="1" mask="0x02" name="fHtmlUnsupported"
+ description="The numbering sequence or format is unsupported (includes tab &amp; size)"/>
+ <bit number="2" mask="0x04" name="fHtmlListTextNotSharpDot" description="The list text is not &quot;#.&quot;"/>
+ <bit number="3" mask="0x08" name="fHtmlNotPeriod" description="Something other than a period is used"/>
+ <bit number="4" mask="0x10" name="fHtmlFirstLineMismatch" description="First line indent mismatch"/>
+ <bit number="5" mask="0x20" name="fHtmlTabLeftIndentMismatch"
+ description="The list tab and the dxaLeft don't match (need table?)"/>
+ <bit number="6" mask="0x40" name="fHtmlHangingIndentBeneathNumber"
+ description="The hanging indent falls beneath the number (need plain text)"/>
+ <bit number="7" mask="0x80" name="fHtmlBuiltInBullet" description="A built-in HTML bullet"/>
+ </field>
+ </fields>
+</record>
diff --git a/src/types/definitions/lfo_type.xml b/src/types/definitions/lfo_type.xml
index 03dc7d198e..cc4d88df34 100644
--- a/src/types/definitions/lfo_type.xml
+++ b/src/types/definitions/lfo_type.xml
@@ -33,19 +33,7 @@
<field type="byte" size="1" name="clfolvl"
description="Count of levels whose format is overridden (see LFOLVL)"/>
<field type="byte" size="1" name="ibstFltAutoNum" description="Used for AUTONUM field emulation"/>
- <field type="byte" size="1" name="grfhic" description="HTML compatibility flags">
- <bit number="0" mask="0x01" name="fHtmlChecked" description="Checked"/>
- <bit number="1" mask="0x02" name="fHtmlUnsupported"
- description="The numbering sequence or format is unsupported (includes tab &amp; size)"/>
- <bit number="2" mask="0x04" name="fHtmlListTextNotSharpDot" description="The list text is not &quot;#.&quot;"/>
- <bit number="3" mask="0x08" name="fHtmlNotPeriod" description="Something other than a period is used"/>
- <bit number="4" mask="0x10" name="fHtmlFirstLineMismatch" description="First line indent mismatch"/>
- <bit number="5" mask="0x20" name="fHtmlTabLeftIndentMismatch"
- description="The list tab and the dxaLeft don't match (need table?)"/>
- <bit number="6" mask="0x40" name="fHtmlHangingIndentBeneathNumber"
- description="The hanging indent falls beneath the number (need plain text)"/>
- <bit number="7" mask="0x80" name="fHtmlBuiltInBullet" description="A built-in HTML bullet"/>
- </field>
+ <field type="Grfhic" size="1" name="grfhic" description="HTML compatibility flags" />
<field type="byte" size="1" name="reserved3" description="Reserved"/>
</fields>
</record>
diff --git a/src/types/definitions/lstf_type.xml b/src/types/definitions/lstf_type.xml
index 807b70ba26..5c7f1d334f 100644
--- a/src/types/definitions/lstf_type.xml
+++ b/src/types/definitions/lstf_type.xml
@@ -45,7 +45,7 @@
<bit mask="0xE0" name="reserved1" deprecated="true"
description="This MUST be zero, and MUST be ignored."/>
</field>
- <field type="byte" size="1" name="grfhic"
+ <field type="Grfhic" size="1" name="grfhic"
description="A grfhic that specifies the HTML incompatibilities of the list."/>
</fields>
</record>
diff --git a/src/types/definitions/lvlf_type.xml b/src/types/definitions/lvlf_type.xml
index 910736bba4..c60a4f1b3f 100644
--- a/src/types/definitions/lvlf_type.xml
+++ b/src/types/definitions/lvlf_type.xml
@@ -59,7 +59,7 @@
description="An unsigned integer that specifies the size, in bytes, of the grpprlPapx in the LVL that contains this LVLF"/>
<field type="short" size="1" name="ilvlRestartLim"
description="An unsigned integer that specifies the first (most-significant) zero-based level after which the number sequence of this level does not restart. The number sequence of this level does restart after any level that is more significant than the specified level. This MUST be less than or equal to the zero-based level of the list to which this LVLF corresponds. If fNoRestart is zero, this MUST be ignored. If this level does not have a number sequence (see nfc), this MUST be ignored"/>
- <field type="short" size="1" name="grfhic"
+ <field type="Grfhic" size="1" name="grfhic"
description="A grfhic that specifies the HTML incompatibilities of the level."/>
</fields>
</record>
diff --git a/src/types/styles/hdftype.xsl b/src/types/styles/hdftype.xsl
index 3360c53c3d..a93d22d875 100644
--- a/src/types/styles/hdftype.xsl
+++ b/src/types/styles/hdftype.xsl
@@ -227,28 +227,76 @@ public abstract class </xsl:text><xsl:call-template name="outputClassName"/><xsl
<xsl:variable name="fieldName" select="recutil:getFieldName(position(),@name,0)"/>
<xsl:call-template name="indent"/>
<xsl:call-template name="indent"/>
- <xsl:text>if ( </xsl:text>
<xsl:choose>
<xsl:when test="substring(@type, string-length(@type)-1)='[]'">
+ <xsl:text>if ( </xsl:text>
<xsl:text>!Arrays.equals( </xsl:text>
<xsl:value-of select="$fieldName"/>
<xsl:text>, other.</xsl:text>
<xsl:value-of select="$fieldName"/>
<xsl:text> )</xsl:text>
+ <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:when test="@type='Grfhic'">
+ <xsl:text>if ( </xsl:text>
+ <xsl:value-of select="$fieldName"/>
+ <xsl:text> == null )</xsl:text>
+ <xsl:call-template name="linebreak"/>
+ <xsl:call-template name="indent"/>
+ <xsl:call-template name="indent"/>
+ <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>if ( other.</xsl:text>
+ <xsl:value-of select="$fieldName"/>
+ <xsl:text> != null )</xsl:text>
+ <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>return false;</xsl:text>
+ <xsl:call-template name="linebreak"/>
+ <xsl:call-template name="indent"/>
+ <xsl:call-template name="indent"/>
+ <xsl:text>}</xsl:text>
+ <xsl:call-template name="linebreak"/>
+ <xsl:call-template name="indent"/>
+ <xsl:call-template name="indent"/>
+ <xsl:text>else if ( !</xsl:text>
+ <xsl:value-of select="$fieldName"/>
+ <xsl:text>.equals( 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> != 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: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:for-each>
<xsl:call-template name="indent"/>
<xsl:call-template name="indent"/>
@@ -279,6 +327,10 @@ public abstract class </xsl:text><xsl:call-template name="outputClassName"/><xsl
<xsl:value-of select="recutil:getFieldName(position(),@name,0)"/>
<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>
<xsl:otherwise>
<xsl:value-of select="recutil:getFieldName(position(),@name,0)"/>
</xsl:otherwise>