_fib.setLcbPlcfsed(tableStream.getOffset() - tableOffset);
tableOffset = tableStream.getOffset();
- /*
- * plcflst (list formats) Written immediately after the end of the
- * previously recorded, if there are any lists defined in the document.
- * This begins with a short count of LSTF structures followed by those
- * LSTF structures. This is immediately followed by the allocated data
- * hanging off the LSTFs. This data consists of the array of LVLs for
- * each LSTF. (Each LVL consists of an LVLF followed by two grpprls and
- * an XST.)
- *
- * Microsoft Office Word 97-2007 Binary File Format (.doc)
- * Specification; Page 25 of 210
- */
-
- // write out the list tables
- if (_lt != null)
- {
- _fib.setFcPlcfLst(tableOffset);
- _lt.writeListDataTo(tableStream);
- _fib.setLcbPlcfLst(tableStream.getOffset() - tableOffset);
- }
-
- /*
- * plflfo (more list formats) Written immediately after the end of the
- * plcflst and its accompanying data, if there are any lists defined in
- * the document. This consists first of a PL of LFO records, followed by
- * the allocated data (if any) hanging off the LFOs. The allocated data
- * consists of the array of LFOLVLFs for each LFO (and each LFOLVLF is
- * immediately followed by some LVLs).
- *
- * Microsoft Office Word 97-2007 Binary File Format (.doc)
- * Specification; Page 26 of 210
- */
+ // write out the list tables
+ if ( _lt != null )
+ {
+ /*
+ * plcflst (list formats) Written immediately after the end of the
+ * previously recorded, if there are any lists defined in the
+ * document. This begins with a short count of LSTF structures
+ * followed by those LSTF structures. This is immediately followed
+ * by the allocated data hanging off the LSTFs. This data consists
+ * of the array of LVLs for each LSTF. (Each LVL consists of an LVLF
+ * followed by two grpprls and an XST.)
+ *
+ * Microsoft Office Word 97-2007 Binary File Format (.doc)
+ * Specification; Page 25 of 210
+ */
+ _lt.writeListDataTo( _fib, tableStream );
+ tableOffset = tableStream.getOffset();
- if (_lt != null)
- {
- _fib.setFcPlfLfo(tableStream.getOffset());
- _lt.writeListOverridesTo(tableStream);
- _fib.setLcbPlfLfo(tableStream.getOffset() - tableOffset);
- tableOffset = tableStream.getOffset();
- }
+ /*
+ * plflfo (more list formats) Written immediately after the end of
+ * the plcflst and its accompanying data, if there are any lists
+ * defined in the document. This consists first of a PL of LFO
+ * records, followed by the allocated data (if any) hanging off the
+ * LFOs. The allocated data consists of the array of LFOLVLFs for
+ * each LFO (and each LFOLVLF is immediately followed by some LVLs).
+ *
+ * Microsoft Office Word 97-2007 Binary File Format (.doc)
+ * Specification; Page 26 of 210
+ */
+ _fib.setFcPlfLfo( tableStream.getOffset() );
+ _lt.writeListOverridesTo( tableStream );
+ _fib.setLcbPlfLfo( tableStream.getOffset() - tableOffset );
+ tableOffset = tableStream.getOffset();
+ }
/*
* sttbfBkmk (table of bookmark name strings) Written immediately after
--- /dev/null
+/* ====================================================================
+ 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.
+==================================================================== */
+package org.apache.poi.hwpf.model;
+
+import org.apache.poi.hwpf.model.types.LSTFAbstractType;
+
+/**
+ * The LSTF structure contains formatting properties that apply to an entire
+ * list.
+ * <p>
+ * Class and fields descriptions are quoted from Microsoft Office Word 97-2007
+ * Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format
+ *
+ * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary
+ * File Format Specification [*.doc] and [MS-DOC] - v20110608 Word
+ * (.doc) Binary File Format
+ */
+class LSTF extends LSTFAbstractType
+{
+ LSTF()
+ {
+ }
+
+ LSTF( byte[] buf, int offset )
+ {
+ super();
+ fillFields( buf, offset );
+ }
+
+}
import java.util.Arrays;
-import org.apache.poi.util.BitField;
-import org.apache.poi.util.BitFieldFactory;
import org.apache.poi.util.Internal;
-import org.apache.poi.util.LittleEndian;
@Internal
public final class ListData
{
- private int _lsid;
- private int _tplc;
- private short[] _rgistd;
- private byte _info;
- private static BitField _fSimpleList = BitFieldFactory.getInstance(0x1);
- private static BitField _fRestartHdn = BitFieldFactory.getInstance(0x2);
- private byte _reserved;
- ListLevel[] _levels;
-
- public ListData(int listID, boolean numbered)
- {
- _lsid = listID;
- _rgistd = new short[9];
-
- for (int x = 0; x < 9; x++)
+ private ListLevel[] _levels;
+
+ private LSTF _lstf;
+
+ ListData( byte[] buf, int offset )
+ {
+ _lstf = new LSTF( buf, offset );
+
+ if ( _lstf.isFSimpleList() )
+ {
+ _levels = new ListLevel[1];
+ }
+ else
+ {
+ _levels = new ListLevel[9];
+ }
+ }
+
+ public ListData( int listID, boolean numbered )
+ {
+ _lstf = new LSTF();
+ _lstf.setLsid( listID );
+ _lstf.setRgistdPara( new short[9] );
+ Arrays.fill( _lstf.getRgistdPara(), (short) StyleSheet.NIL_STYLE );
+
+ _levels = new ListLevel[9];
+ for ( int x = 0; x < _levels.length; x++ )
+ {
+ _levels[x] = new ListLevel( x, numbered );
+ }
+ }
+
+ @Override
+ public boolean equals( Object obj )
+ {
+ if ( this == obj )
+ return true;
+ if ( obj == null )
+ return false;
+ if ( getClass() != obj.getClass() )
+ return false;
+ ListData other = (ListData) obj;
+ if ( !Arrays.equals( _levels, other._levels ) )
+ return false;
+ if ( _lstf == null )
+ {
+ if ( other._lstf != null )
+ return false;
+ }
+ else if ( !_lstf.equals( other._lstf ) )
+ return false;
+ return true;
+ }
+
+ /**
+ * Gets the level associated to a particular List at a particular index.
+ *
+ * @param index
+ * 1-based index
+ * @return a list level
+ */
+ public ListLevel getLevel( int index )
{
- _rgistd[x] = StyleSheet.NIL_STYLE;
+ return _levels[index - 1];
}
- _levels = new ListLevel[9];
+ public ListLevel[] getLevels()
+ {
+ return _levels;
+ }
- for (int x = 0; x < _levels.length; x++)
+ public int getLevelStyle( int index )
{
- _levels[x] = new ListLevel(x, numbered);
+ return _lstf.getRgistdPara()[index];
}
- }
-
- ListData(byte[] buf, int offset)
- {
- _lsid = LittleEndian.getInt(buf, offset);
- offset += LittleEndian.INT_SIZE;
- _tplc = LittleEndian.getInt(buf, offset);
- offset += LittleEndian.INT_SIZE;
- _rgistd = new short[9];
- for (int x = 0; x < 9; x++)
+
+ public int getLsid()
{
- _rgistd[x] = LittleEndian.getShort(buf, offset);
- offset += LittleEndian.SHORT_SIZE;
+ return _lstf.getLsid();
}
- _info = buf[offset++];
- _reserved = buf[offset];
- if (_fSimpleList.getValue(_info) > 0)
+
+ @Override
+ public int hashCode()
{
- _levels = new ListLevel[1];
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + Arrays.hashCode( _levels );
+ result = prime * result + ( ( _lstf == null ) ? 0 : _lstf.hashCode() );
+ return result;
}
- else
+
+ public int numLevels()
+ {
+ return _levels.length;
+ }
+
+ int resetListID()
+ {
+ _lstf.setLsid( (int) ( Math.random() * System.currentTimeMillis() ) );
+ return _lstf.getLsid();
+ }
+
+ public void setLevel( int index, ListLevel level )
{
- _levels = new ListLevel[9];
+ _levels[index] = level;
}
- }
-
- public int getLsid()
- {
- return _lsid;
- }
-
- public int numLevels()
- {
- return _levels.length;
- }
-
- public void setLevel(int index, ListLevel level)
- {
- _levels[index] = level;
- }
-
- public ListLevel[] getLevels()
- {
- return _levels;
- }
-
- /**
- * Gets the level associated to a particular List at a particular index.
- *
- * @param index 1-based index
- * @return a list level
- */
- public ListLevel getLevel(int index)
- {
- return _levels[index - 1];
- }
-
- public int getLevelStyle(int index)
- {
- return _rgistd[index];
- }
-
- public void setLevelStyle(int index, int styleIndex)
- {
- _rgistd[index] = (short)styleIndex;
- }
-
- public boolean equals(Object obj)
- {
- if (obj == null)
+ public void setLevelStyle( int index, int styleIndex )
{
- return false;
+ _lstf.getRgistdPara()[index] = (short) styleIndex;
}
- ListData lst = (ListData)obj;
- return lst._info == _info && Arrays.equals(lst._levels, _levels) &&
- lst._lsid == _lsid && lst._reserved == _reserved && lst._tplc == _tplc &&
- Arrays.equals(lst._rgistd, _rgistd);
- }
-
- int resetListID()
- {
- _lsid = (int)(Math.random() * System.currentTimeMillis());
- return _lsid;
- }
-
- public byte[] toByteArray()
- {
- byte[] buf = new byte[28];
- int offset = 0;
- LittleEndian.putInt(buf, _lsid);
- offset += LittleEndian.INT_SIZE;
- LittleEndian.putInt(buf, offset, _tplc);
- offset += LittleEndian.INT_SIZE;
- for (int x = 0; x < 9; x++)
+ public byte[] toByteArray()
{
- LittleEndian.putShort(buf, offset, _rgistd[x]);
- offset += LittleEndian.SHORT_SIZE;
+ return _lstf.serialize();
}
- buf[offset++] = _info;
- buf[offset] = _reserved;
- return buf;
- }
}
}
- public ListTables(byte[] tableStream, int lstOffset, final int lfoOffset)
- {
- // get the list data
- int length = LittleEndian.getShort(tableStream, lstOffset);
- lstOffset += LittleEndian.SHORT_SIZE;
- int levelOffset = lstOffset + (length * LIST_DATA_SIZE);
-
- for (int x = 0; x < length; x++)
+ public ListTables( byte[] tableStream, final int lstOffset,
+ final int lfoOffset )
{
- ListData lst = new ListData(tableStream, lstOffset);
- _listMap.put(Integer.valueOf(lst.getLsid()), lst);
- lstOffset += LIST_DATA_SIZE;
+ {
+ /*
+ * The PlfLst structure contains the list formatting information for
+ * the document. -- Page 425 of 621. [MS-DOC] -- v20110315 Word
+ * (.doc) Binary File Format
+ */
+ int offset = lstOffset;
- int num = lst.numLevels();
- for (int y = 0; y < num; y++)
- {
- ListLevel lvl = new ListLevel(tableStream, levelOffset);
- lst.setLevel(y, lvl);
- levelOffset += lvl.getSizeInBytes();
- }
- }
+ int cLst = LittleEndian.getShort( tableStream, offset );
+ offset += LittleEndian.SHORT_SIZE;
+ int levelOffset = offset + ( cLst * LIST_DATA_SIZE );
+
+ for ( int x = 0; x < cLst; x++ )
+ {
+ ListData lst = new ListData( tableStream, offset );
+ _listMap.put( Integer.valueOf( lst.getLsid() ), lst );
+ offset += LSTF.getSize();
+
+ int num = lst.numLevels();
+ for ( int y = 0; y < num; y++ )
+ {
+ ListLevel lvl = new ListLevel( tableStream, levelOffset );
+ lst.setLevel( y, lvl );
+ levelOffset += lvl.getSizeInBytes();
+ }
+ }
+ }
{
/*
return lsid;
}
- public void writeListDataTo(HWPFOutputStream tableStream)
- throws IOException
- {
+ public void writeListDataTo( FileInformationBlock fib,
+ HWPFOutputStream tableStream ) throws IOException
+ {
+ final int startOffset = tableStream.getOffset();
+ fib.setFcPlcfLst( startOffset );
+
int listSize = _listMap.size();
// use this stream as a buffer for the levels since their size varies.
levelBuf.write(lvls[y].toByteArray());
}
}
- tableStream.write(levelBuf.toByteArray());
- }
+
+ /*
+ * An array of LVLs is appended to the PlfLst. lcbPlfLst does not
+ * account for the array of LVLs. -- Page 76 of 621 -- [MS-DOC] --
+ * v20110315 Word (.doc) Binary File Format
+ */
+ fib.setLcbPlcfLst( tableStream.getOffset() - startOffset );
+ tableStream.write( levelBuf.toByteArray() );
+ }
public void writeListOverridesTo( HWPFOutputStream tableStream )
throws IOException
--- /dev/null
+/* ====================================================================\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+==================================================================== */\r
+package org.apache.poi.hwpf.model.types;\r
+\r
+import java.util.Arrays;\r
+\r
+import org.apache.poi.util.BitField;\r
+import org.apache.poi.util.Internal;\r
+import org.apache.poi.util.LittleEndian;\r
+\r
+/**\r
+ * The LSTF structure contains formatting properties that apply to an entire list.\r
+ <p>Class and fields descriptions are quoted from Microsoft Office Word 97-2007 Binary\r
+ File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format\r
+ \r
+ * <p>\r
+ * NOTE: This source is automatically generated please do not modify this file. Either subclass or\r
+ * remove the record in src/types/definitions.\r
+ * <p>\r
+ * This class is internal. It content or properties may change without notice \r
+ * due to changes in our knowledge of internal Microsoft Word binary structures.\r
+\r
+ * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary File Format\r
+ Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format\r
+ \r
+ */\r
+@Internal\r
+public abstract class LSTFAbstractType\r
+{\r
+\r
+ protected int field_1_lsid;\r
+ protected int field_2_tplc;\r
+ protected short[] field_3_rgistdPara;\r
+ protected byte field_4_flags;\r
+ /**/private static final BitField fSimpleList = new BitField(0x01);\r
+ /**/private static final BitField unused1 = new BitField(0x02);\r
+ /**/private static final BitField fAutoNum = new BitField(0x04);\r
+ /**/private static final BitField unused2 = new BitField(0x08);\r
+ /**/private static final BitField fHybrid = new BitField(0x10);\r
+ /**/private static final BitField reserved1 = new BitField(0xE0);\r
+ protected byte field_5_grfhic;\r
+\r
+ protected LSTFAbstractType()\r
+ {\r
+ this.field_3_rgistdPara = new short[0];\r
+ }\r
+\r
+ protected void fillFields( byte[] data, int offset )\r
+ {\r
+ field_1_lsid = LittleEndian.getInt( data, 0x0 + offset );\r
+ field_2_tplc = LittleEndian.getInt( data, 0x4 + offset );\r
+ field_3_rgistdPara = LittleEndian.getShortArray( data, 0x8 + offset, 18 );\r
+ field_4_flags = data[ 0x1a + offset ];\r
+ field_5_grfhic = data[ 0x1b + offset ];\r
+ }\r
+\r
+ public void serialize( byte[] data, int offset )\r
+ {\r
+ LittleEndian.putInt( data, 0x0 + offset, field_1_lsid );\r
+ LittleEndian.putInt( data, 0x4 + offset, field_2_tplc );\r
+ LittleEndian.putShortArray( data, 0x8 + offset, field_3_rgistdPara );\r
+ data[ 0x1a + offset ] = field_4_flags;\r
+ data[ 0x1b + offset ] = field_5_grfhic;\r
+ }\r
+\r
+ public byte[] serialize()\r
+ {\r
+ final byte[] result = new byte[ getSize() ];\r
+ serialize( result, 0 );\r
+ return result;\r
+ }\r
+\r
+ /**\r
+ * Size of record\r
+ */\r
+ public static int getSize()\r
+ {\r
+ return 0 + 4 + 4 + 18 + 1 + 1;\r
+ }\r
+\r
+ @Override\r
+ public boolean equals( Object obj )\r
+ {\r
+ if ( this == obj )\r
+ return true;\r
+ if ( obj == null )\r
+ return false;\r
+ if ( getClass() != obj.getClass() )\r
+ return false;\r
+ LSTFAbstractType other = (LSTFAbstractType) obj;\r
+ if ( field_1_lsid != other.field_1_lsid )\r
+ return false;\r
+ if ( field_2_tplc != other.field_2_tplc )\r
+ return false;\r
+ if ( !Arrays.equals( field_3_rgistdPara, other.field_3_rgistdPara ) )\r
+ return false;\r
+ if ( field_4_flags != other.field_4_flags )\r
+ return false;\r
+ if ( field_5_grfhic != other.field_5_grfhic )\r
+ return false;\r
+ return true;\r
+ }\r
+\r
+ @Override\r
+ public int hashCode()\r
+ {\r
+ final int prime = 31;\r
+ int result = 1;\r
+ result = prime * result + field_1_lsid;\r
+ result = prime * result + field_2_tplc;\r
+ result = prime * result + Arrays.hashCode( field_3_rgistdPara );\r
+ result = prime * result + field_4_flags;\r
+ result = prime * result + field_5_grfhic;\r
+ return result;\r
+ }\r
+\r
+ public String toString()\r
+ {\r
+ StringBuilder builder = new StringBuilder();\r
+ builder.append("[LSTF]\n");\r
+ builder.append(" .lsid = ");\r
+ builder.append(" (").append(getLsid()).append(" )\n");\r
+ builder.append(" .tplc = ");\r
+ builder.append(" (").append(getTplc()).append(" )\n");\r
+ builder.append(" .rgistdPara = ");\r
+ builder.append(" (").append(getRgistdPara()).append(" )\n");\r
+ builder.append(" .flags = ");\r
+ builder.append(" (").append(getFlags()).append(" )\n");\r
+ builder.append(" .fSimpleList = ").append(isFSimpleList()).append('\n');\r
+ builder.append(" .unused1 = ").append(isUnused1()).append('\n');\r
+ builder.append(" .fAutoNum = ").append(isFAutoNum()).append('\n');\r
+ builder.append(" .unused2 = ").append(isUnused2()).append('\n');\r
+ builder.append(" .fHybrid = ").append(isFHybrid()).append('\n');\r
+ builder.append(" .reserved1 = ").append(getReserved1()).append('\n');\r
+ builder.append(" .grfhic = ");\r
+ builder.append(" (").append(getGrfhic()).append(" )\n");\r
+\r
+ builder.append("[/LSTF]\n");\r
+ return builder.toString();\r
+ }\r
+\r
+ /**\r
+ * A signed integer that specifies the list identifier. This MUST be unique for each LSTF. This value MUST not be 0xFFFFFFFF.\r
+ */\r
+ @Internal\r
+ public int getLsid()\r
+ {\r
+ return field_1_lsid;\r
+ }\r
+\r
+ /**\r
+ * A signed integer that specifies the list identifier. This MUST be unique for each LSTF. This value MUST not be 0xFFFFFFFF.\r
+ */\r
+ @Internal\r
+ public void setLsid( int field_1_lsid )\r
+ {\r
+ this.field_1_lsid = field_1_lsid;\r
+ }\r
+\r
+ /**\r
+ * A Tplc that specifies a unique identifier for this LSTF that MAY be used for user interface purposes. If fHybrid is nonzero, this MUST be ignored.\r
+ */\r
+ @Internal\r
+ public int getTplc()\r
+ {\r
+ return field_2_tplc;\r
+ }\r
+\r
+ /**\r
+ * A Tplc that specifies a unique identifier for this LSTF that MAY be used for user interface purposes. If fHybrid is nonzero, this MUST be ignored.\r
+ */\r
+ @Internal\r
+ public void setTplc( int field_2_tplc )\r
+ {\r
+ this.field_2_tplc = field_2_tplc;\r
+ }\r
+\r
+ /**\r
+ * An array of nine 16-bit signed integers. Each element of rgistdPara specifies the ISTD of the style that is linked to the corresponding level in the list. If no style is linked to a given level, the value of the corresponding element of rgistdPara MUST be 0x0FFF.\r
+ */\r
+ @Internal\r
+ public short[] getRgistdPara()\r
+ {\r
+ return field_3_rgistdPara;\r
+ }\r
+\r
+ /**\r
+ * An array of nine 16-bit signed integers. Each element of rgistdPara specifies the ISTD of the style that is linked to the corresponding level in the list. If no style is linked to a given level, the value of the corresponding element of rgistdPara MUST be 0x0FFF.\r
+ */\r
+ @Internal\r
+ public void setRgistdPara( short[] field_3_rgistdPara )\r
+ {\r
+ this.field_3_rgistdPara = field_3_rgistdPara;\r
+ }\r
+\r
+ /**\r
+ * Get the flags field for the LSTF record.\r
+ */\r
+ @Internal\r
+ public byte getFlags()\r
+ {\r
+ return field_4_flags;\r
+ }\r
+\r
+ /**\r
+ * Set the flags field for the LSTF record.\r
+ */\r
+ @Internal\r
+ public void setFlags( byte field_4_flags )\r
+ {\r
+ this.field_4_flags = field_4_flags;\r
+ }\r
+\r
+ /**\r
+ * A grfhic that specifies the HTML incompatibilities of the list..\r
+ */\r
+ @Internal\r
+ public byte getGrfhic()\r
+ {\r
+ return field_5_grfhic;\r
+ }\r
+\r
+ /**\r
+ * A grfhic that specifies the HTML incompatibilities of the list..\r
+ */\r
+ @Internal\r
+ public void setGrfhic( byte field_5_grfhic )\r
+ {\r
+ this.field_5_grfhic = field_5_grfhic;\r
+ }\r
+\r
+ /**\r
+ * Sets the fSimpleList field value.\r
+ * A bit that, when set to 0x1, specifies that this LSTF represents a simple (one-level) list that has one corresponding LVL (see the fcPlfLst field of FibRgFcLcb97). Otherwise, this LSTF represents a multi-level list that has nine corresponding LVLs\r
+ */\r
+ @Internal\r
+ public void setFSimpleList( boolean value )\r
+ {\r
+ field_4_flags = (byte)fSimpleList.setBoolean(field_4_flags, value);\r
+ }\r
+\r
+ /**\r
+ * A bit that, when set to 0x1, specifies that this LSTF represents a simple (one-level) list that has one corresponding LVL (see the fcPlfLst field of FibRgFcLcb97). Otherwise, this LSTF represents a multi-level list that has nine corresponding LVLs\r
+ * @return the fSimpleList field value.\r
+ */\r
+ @Internal\r
+ public boolean isFSimpleList()\r
+ {\r
+ return fSimpleList.isSet(field_4_flags);\r
+ }\r
+\r
+ /**\r
+ * Sets the unused1 field value.\r
+ * This bit MUST be ignored\r
+ */\r
+ @Internal\r
+ public void setUnused1( boolean value )\r
+ {\r
+ field_4_flags = (byte)unused1.setBoolean(field_4_flags, value);\r
+ }\r
+\r
+ /**\r
+ * This bit MUST be ignored\r
+ * @return the unused1 field value.\r
+ * @deprecated This field should not be used according to specification\r
+ */\r
+ @Internal\r
+ @Deprecated\r
+ public boolean isUnused1()\r
+ {\r
+ return unused1.isSet(field_4_flags);\r
+ }\r
+\r
+ /**\r
+ * Sets the fAutoNum field value.\r
+ * A bit that specifies whether the list that this LSTF represents is used for the AUTONUMOUT, AUTONUMLGL, and AUTONUM fields (see AUTONUMOUT, AUTONUMLGL, and AUTONUM in flt)\r
+ */\r
+ @Internal\r
+ public void setFAutoNum( boolean value )\r
+ {\r
+ field_4_flags = (byte)fAutoNum.setBoolean(field_4_flags, value);\r
+ }\r
+\r
+ /**\r
+ * A bit that specifies whether the list that this LSTF represents is used for the AUTONUMOUT, AUTONUMLGL, and AUTONUM fields (see AUTONUMOUT, AUTONUMLGL, and AUTONUM in flt)\r
+ * @return the fAutoNum field value.\r
+ */\r
+ @Internal\r
+ public boolean isFAutoNum()\r
+ {\r
+ return fAutoNum.isSet(field_4_flags);\r
+ }\r
+\r
+ /**\r
+ * Sets the unused2 field value.\r
+ * This bit MUST be ignored\r
+ */\r
+ @Internal\r
+ public void setUnused2( boolean value )\r
+ {\r
+ field_4_flags = (byte)unused2.setBoolean(field_4_flags, value);\r
+ }\r
+\r
+ /**\r
+ * This bit MUST be ignored\r
+ * @return the unused2 field value.\r
+ * @deprecated This field should not be used according to specification\r
+ */\r
+ @Internal\r
+ @Deprecated\r
+ public boolean isUnused2()\r
+ {\r
+ return unused2.isSet(field_4_flags);\r
+ }\r
+\r
+ /**\r
+ * Sets the fHybrid field value.\r
+ * A bit that specifies whether the list this LSTF defines is a hybrid list\r
+ */\r
+ @Internal\r
+ public void setFHybrid( boolean value )\r
+ {\r
+ field_4_flags = (byte)fHybrid.setBoolean(field_4_flags, value);\r
+ }\r
+\r
+ /**\r
+ * A bit that specifies whether the list this LSTF defines is a hybrid list\r
+ * @return the fHybrid field value.\r
+ */\r
+ @Internal\r
+ public boolean isFHybrid()\r
+ {\r
+ return fHybrid.isSet(field_4_flags);\r
+ }\r
+\r
+ /**\r
+ * Sets the reserved1 field value.\r
+ * This MUST be zero, and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public void setReserved1( byte value )\r
+ {\r
+ field_4_flags = (byte)reserved1.setValue(field_4_flags, value);\r
+ }\r
+\r
+ /**\r
+ * This MUST be zero, and MUST be ignored.\r
+ * @return the reserved1 field value.\r
+ * @deprecated This field should not be used according to specification\r
+ */\r
+ @Internal\r
+ @Deprecated\r
+ public byte getReserved1()\r
+ {\r
+ return ( byte )reserved1.getValue(field_4_flags);\r
+ }\r
+\r
+} // END OF CLASS\r
HWPFOutputStream tableOut = fileSys.getStream ("1Table");
- listTables.writeListDataTo (tableOut);
+ listTables.writeListDataTo (fib, tableOut);
int offset = tableOut.getOffset ();
listTables.writeListOverridesTo (tableOut);
--- /dev/null
+<?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="LSTF" package="org.apache.poi.hwpf.model.types">
+ <suffix>AbstractType</suffix>
+ <description>The LSTF structure contains formatting properties that apply to an entire list.
+ <p>Class and fields descriptions are quoted from Microsoft Office Word 97-2007 Binary
+ File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format
+ </description>
+ <author>Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary File Format
+ Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format
+ </author>
+ <fields>
+ <field type="int" size="4" name="lsid"
+ description="A signed integer that specifies the list identifier. This MUST be unique for each LSTF. This value MUST not be 0xFFFFFFFF"/>
+ <field type="int" size="4" name="tplc"
+ description="A Tplc that specifies a unique identifier for this LSTF that MAY be used for user interface purposes. If fHybrid is nonzero, this MUST be ignored"/>
+ <field type="short[]" size="18" name="rgistdPara"
+ description="An array of nine 16-bit signed integers. Each element of rgistdPara specifies the ISTD of the style that is linked to the corresponding level in the list. If no style is linked to a given level, the value of the corresponding element of rgistdPara MUST be 0x0FFF"/>
+ <field type="byte" size="1" name="flags">
+ <bit mask="0x01" name="fSimpleList"
+ description="A bit that, when set to 0x1, specifies that this LSTF represents a simple (one-level) list that has one corresponding LVL (see the fcPlfLst field of FibRgFcLcb97). Otherwise, this LSTF represents a multi-level list that has nine corresponding LVLs"/>
+ <bit mask="0x02" name="unused1" deprecated="true" description="This bit MUST be ignored"/>
+ <bit mask="0x04" name="fAutoNum"
+ description="A bit that specifies whether the list that this LSTF represents is used for the AUTONUMOUT, AUTONUMLGL, and AUTONUM fields (see AUTONUMOUT, AUTONUMLGL, and AUTONUM in flt)"/>
+ <bit mask="0x08" name="unused2" deprecated="true" description="This bit MUST be ignored"/>
+ <bit mask="0x10" name="fHybrid"
+ description="A bit that specifies whether the list this LSTF defines is a hybrid list"/>
+ <bit mask="0xE0" name="reserved1" deprecated="true"
+ description="This MUST be zero, and MUST be ignored."/>
+ </field>
+ <field type="byte" size="1" name="grfhic"
+ description="A grfhic that specifies the HTML incompatibilities of the list."/>
+ </fields>
+</record>
<xsl:call-template name="indent"/>
<xsl:text>if ( </xsl:text>
<xsl:choose>
- <xsl:when test="@type='byte[]'">
+ <xsl:when test="substring(@type, string-length(@type)-1)='[]'">
<xsl:text>!Arrays.equals( </xsl:text>
<xsl:value-of select="$fieldName"/>
<xsl:text>, other.</xsl:text>
<xsl:call-template name="indent"/>
<xsl:text>result = prime * result + </xsl:text>
<xsl:choose>
- <xsl:when test="@type='byte[]'">
+ <xsl:when test="substring(@type, string-length(@type)-1)='[]'">
<xsl:text>Arrays.hashCode( </xsl:text>
<xsl:value-of select="recutil:getFieldName(position(),@name,0)"/>
<xsl:text> )</xsl:text>