diff options
author | Sergey Vladimirov <sergey@apache.org> | 2012-11-06 16:26:43 +0000 |
---|---|---|
committer | Sergey Vladimirov <sergey@apache.org> | 2012-11-06 16:26:43 +0000 |
commit | e9b4aa87f0a5492ae5b0a66f5cc96ba394a36a3e (patch) | |
tree | b1815daf9b7a2cfa5775f6a6037aeee8e546b116 /src/types | |
parent | 932099875b755338cd832bbb6a1e07a4839a019e (diff) | |
download | poi-e9b4aa87f0a5492ae5b0a66f5cc96ba394a36a3e.tar.gz poi-e9b4aa87f0a5492ae5b0a66f5cc96ba394a36a3e.zip |
Bug 52583 - Conversion to html : Problem with combobox
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1406208 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/types')
-rw-r--r-- | src/types/definitions/FFData_type.xml | 81 | ||||
-rw-r--r-- | src/types/styles/hdftype.xsl | 67 |
2 files changed, 128 insertions, 20 deletions
diff --git a/src/types/definitions/FFData_type.xml b/src/types/definitions/FFData_type.xml new file mode 100644 index 0000000000..2016adb6dd --- /dev/null +++ b/src/types/definitions/FFData_type.xml @@ -0,0 +1,81 @@ +<?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="FFDataBase" package="org.apache.poi.hwpf.model.types"> + <suffix>AbstractType</suffix> + <description>The FFData structure specifies form field data for a text + box, check box, or drop-down list box. <p>Class and fields + descriptions are quoted from [MS-DOC] -- v20121003 Word (.doc) Binary + File Format; Copyright (c) 2012 Microsoft Corporation; Release: + October 8, 2012 + </description> + <author>Sergey Vladimirov; according to [MS-DOC] -- v20121003 Word + (.doc) Binary File Format; Copyright (c) 2012 Microsoft Corporation; + Release: October 8, 2012 + </author> + <fields> + <field type="long" size="4" name="version" + description="An unsigned integer that MUST be 0xFFFFFFFF" /> + <field type="short" size="2" name="bits" + description="An FFDataBits that specifies the type and state of this form field"> + <bit mask="0x0003" name="iType" + description="An unsigned integer that specifies the type of the form field. "> + <const type="byte" value="0" name="Text" + description="Specifies that the form field is a textbox." /> + <const type="byte" value="1" name="Chck" + description="Specifies that the form field is a checkbox." /> + <const type="byte" value="2" name="Drop" + description="Specifies that the form field is a dropdown list box." /> + </bit> + <bit mask="0x007C" name="iRes" + description="An unsigned integer. If iType is iTypeText (0), then iRes MUST be 0. If iType is iTypeChck (1), iRes specifies the state of the checkbox and MUST be 0 (unchecked), 1 (checked), or 25 (undefined). Undefined checkboxes are treated as unchecked. If iType is iTypeDrop (2), iRes specifies the current selected list box item. A value of 25 specifies the selection is undefined. Otherwise, iRes is a zero-based index into FFData.hsttbDropList." /> + <bit mask="0x0080" name="fOwnHelp" + description="A bit that specifies whether the form field has custom help text in FFData.xstzHelpText. If fOwnHelp is 0, FFData.xstzHelpText contains an empty or auto-generated string." /> + <bit mask="0x0100" name="fOwnStat" + description="A bit that specifies whether the form field has custom status bar text in FFData.xstzStatText. If fOwnStat is 0, FFData.xstzStatText contains an empty or auto-generated string." /> + <bit mask="0x0200" name="fProt" + description="A bit that specifies whether the form field is protected and its value cannot be changed." /> + <bit mask="0x0400" name="iSize" + description="A bit that specifies whether the size of a checkbox is automatically determined by the text size where the checkbox is located. This value MUST be 0 if iType is not iTypeChck (1)." /> + <bit mask="0x3800" name="iTypeTxt" + description="An unsigned integer that specifies the type of the textbox. If iType is not iTypeText (0), iTypeTxt MUST be 0 and MUST be ignored." > + <const type="byte" value="0" name="Reg" + description="Specifies that the textbox value is regular text." /> + <const type="byte" value="0" name="Num" + description="Specifies that the textbox value is a number." /> + <const type="byte" value="0" name="Date" + description="Specifies that the textbox value is a date or time." /> + <const type="byte" value="0" name="CurDate" + description="Specifies that the textbox value is the current date." /> + <const type="byte" value="0" name="CurTime" + description="Specifies that the textbox value is the current time." /> + <const type="byte" value="0" name="Calc" + description="Specifies that the textbox value is calculated from an expression. The expression is given by FFData.xstzTextDef." /> + </bit> + <bit mask="0x4000" name="fRecalc" + description="A bit that specifies whether the value of the field is automatically calculated after the field is modified." /> + <bit mask="0x8000" name="fHasListBox" + description="A bit that specifies that the form field has a list box. This value MUST be 1 if iType is iTypeDrop (2). Otherwise, this value MUST be 0." /> + </field> + <field type="int" size="2" name="cch" + description="An unsigned integer that specifies the maximum length, in characters, of the value of the textbox. This value MUST NOT exceed 32767. A value of 0 means there is no maximum length of the value of the textbox. If bits.iType is not iTypeText (0), this value MUST be 0." /> + <field type="int" size="2" name="hps" + description="An unsigned integer. If bits.iType is iTypeChck (1), hps specifies the size, in half-points, of the checkbox and MUST be between 2 and 3168, inclusive. If bits.iType is not iTypeChck (1), hps is undefined and MUST be ignored." /> + </fields> +</record> diff --git a/src/types/styles/hdftype.xsl b/src/types/styles/hdftype.xsl index ab923d1921..d8c90e7523 100644 --- a/src/types/styles/hdftype.xsl +++ b/src/types/styles/hdftype.xsl @@ -352,10 +352,22 @@ public abstract class </xsl:text><xsl:call-template name="outputClassName"/><xsl <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:when test="@type='byte' or @type='double' or @type='int' or @type='short'"> <xsl:text> + </xsl:text> <xsl:value-of select="$fieldName"/> </xsl:when> + <xsl:when test="@type='long'"> + <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> + (int) ( </xsl:text> + <xsl:value-of select="$fieldName"/> + <xsl:text> ^ ( </xsl:text> + <xsl:value-of select="$fieldName"/> + <xsl:text> >>> 32 ) )</xsl:text> + </xsl:when> <xsl:otherwise> <xsl:call-template name="linebreak" /> <xsl:call-template name="indent" /> @@ -440,27 +452,42 @@ public abstract class </xsl:text><xsl:call-template name="outputClassName"/><xsl <xsl:value-of select="@mask"/> <xsl:text>);</xsl:text> <xsl:call-template name="linebreak"/> + <xsl:apply-templates select="const"/> </xsl:template> - <xsl:template match="const"> - <xsl:if test="@description"> - <xsl:call-template name="indent"/> - <xsl:text>/** </xsl:text> - <xsl:value-of select="@description"/> - <xsl:text> */</xsl:text> - <xsl:call-template name="linebreak"/> - </xsl:if> - <xsl:call-template name="indent"/> - <xsl:text>/**/</xsl:text> - <xsl:text>protected final static </xsl:text> - <xsl:value-of select="@type"/> - <xsl:text> </xsl:text> - <xsl:value-of select="recutil:getConstName(../@name,@name,0)"/> - <xsl:text> = </xsl:text> - <xsl:value-of select="@value"/> - <xsl:text>;</xsl:text> - <xsl:call-template name="linebreak"/> - </xsl:template> + <xsl:template match="const"> + <xsl:if test="@description"> + <xsl:call-template name="indent" /> + <xsl:choose> + <xsl:when test="name(..) = 'bit'"> + <xsl:text>/** </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>/** </xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="@description" /> + <xsl:text> */</xsl:text> + <xsl:call-template name="linebreak" /> + </xsl:if> + <xsl:call-template name="indent" /> + <xsl:choose> + <xsl:when test="name(..) = 'bit'"> + <xsl:text>/* */</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>/**/</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:text>protected final static </xsl:text> + <xsl:value-of select="@type" /> + <xsl:text> </xsl:text> + <xsl:value-of select="recutil:getConstName(../@name,@name,0)" /> + <xsl:text> = </xsl:text> + <xsl:value-of select="@value" /> + <xsl:text>;</xsl:text> + <xsl:call-template name="linebreak" /> + </xsl:template> <xsl:template match="const" mode="listconsts"> <xsl:call-template name="linebreak"/> |