_cpSplit = new CPSplitCalculator(_fib);
// Is this document too old for us?
- if(_fib.getNFib() < 106) {
+ if(_fib.getFibBase().getNFib() < 106) {
throw new OldWordFileFormatException("The document is too old - Word 95 or older. Try HWPFOldDocument instead?");
}
// use the fib to determine the name of the table stream.
String name = STREAM_TABLE_0;
- if (_fib.isFWhichTblStm())
+ if (_fib.getFibBase().isFWhichTblStm())
{
name = STREAM_TABLE_1;
}
tableOffset = tableStream.getOffset();
// set some variables in the FileInformationBlock.
- _fib.setFcMin(fcMin);
- _fib.setFcMac(fcMac);
+ _fib.getFibBase().setFcMin(fcMin);
+ _fib.getFibBase().setFcMac(fcMac);
_fib.setCbMac(wordDocumentStream.getOffset());
// make sure that the table, doc and data streams use big blocks.
}
// Table1 stream will be used
- _fib.setFWhichTblStm( true );
+ _fib.getFibBase().setFWhichTblStm( true );
// write out the FileInformationBlock.
//_fib.serialize(mainBuf, 0);
// Create our FIB, and check for the doc being encrypted
_fib = new FileInformationBlock(_mainStream);
- if (_fib.isFEncrypted()) {
+ if (_fib.getFibBase().isFEncrypted()) {
throw new EncryptedDocumentException("Cannot process encrypted word files!");
}
// We need to get hold of the text that makes up the
// document, which might be regular or fast-saved
StringBuffer text = new StringBuffer();
- if(_fib.isFComplex()) {
+ if(_fib.getFibBase().isFComplex()) {
ComplexFileTable cft = new ComplexFileTable(
_mainStream, _mainStream,
- complexTableOffset, _fib.getFcMin()
+ complexTableOffset, _fib.getFibBase().getFcMin()
);
tpt = cft.getTextPieceTable();
// TODO Build the Piece Descriptor properly
// (We have to fake it, as they don't seem to have a proper Piece table)
PieceDescriptor pd = new PieceDescriptor(new byte[] {0,0, 0,0,0,127, 0,0}, 0);
- pd.setFilePosition(_fib.getFcMin());
+ pd.setFilePosition(_fib.getFibBase().getFcMin());
// Generate a single Text Piece Table, with a single Text Piece
// which covers all the (8 bit only) text in the file
tpt = new TextPieceTable();
- byte[] textData = new byte[_fib.getFcMac()-_fib.getFcMin()];
- System.arraycopy(_mainStream, _fib.getFcMin(), textData, 0, textData.length);
+ byte[] textData = new byte[_fib.getFibBase().getFcMac()-_fib.getFibBase().getFcMin()];
+ System.arraycopy(_mainStream, _fib.getFibBase().getFcMin(), textData, 0, textData.length);
TextPiece tp = new TextPiece(
0, textData.length, textData, pd
);
// Now we can fetch the character and paragraph properties
_cbt = new OldCHPBinTable(
_mainStream, chpTableOffset, chpTableSize,
- _fib.getFcMin(), tpt
+ _fib.getFibBase().getFcMin(), tpt
);
_pbt = new OldPAPBinTable(
_mainStream, papTableOffset, papTableSize,
- _fib.getFcMin(), tpt
+ _fib.getFibBase().getFcMin(), tpt
);
_st = new OldSectionTable(
_mainStream, sedTableOffset, sedTableSize,
- _fib.getFcMin(), tpt
+ _fib.getFibBase().getFcMin(), tpt
);
}
public Range getOverallRange()
{
// Life is easy when we have no footers, headers or unicode!
- return new Range( 0, _fib.getFcMac() - _fib.getFcMin(), this );
+ return new Range( 0, _fib.getFibBase().getFcMac() - _fib.getFibBase().getFcMin(), this );
}
public Range getRange()
--- /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.FibBaseAbstractType;
+import org.apache.poi.util.Internal;
+
+/**
+ * Base part of the File information Block (FibBase). Holds the core part of the
+ * FIB, from the first 32 bytes.
+ * <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 Andrew C. Oliver; Sergey Vladimirov; according to Microsoft Office
+ * Word 97-2007 Binary File Format Specification [*.doc] and [MS-DOC] -
+ * v20110608 Word (.doc) Binary File Format
+ */
+@Internal
+public class FibBase extends FibBaseAbstractType
+{
+
+ public FibBase()
+ {
+ }
+
+ public FibBase( byte[] std, int offset )
+ {
+ fillFields( std, offset );
+ }
+
+ @Override
+ @SuppressWarnings( "deprecation" )
+ public boolean equals( Object obj )
+ {
+ if ( this == obj )
+ return true;
+ if ( obj == null )
+ return false;
+ if ( getClass() != obj.getClass() )
+ return false;
+ FibBase other = (FibBase) obj;
+ if ( field_10_flags2 != other.field_10_flags2 )
+ return false;
+ if ( field_11_Chs != other.field_11_Chs )
+ return false;
+ if ( field_12_chsTables != other.field_12_chsTables )
+ return false;
+ if ( field_13_fcMin != other.field_13_fcMin )
+ return false;
+ if ( field_14_fcMac != other.field_14_fcMac )
+ return false;
+ if ( field_1_wIdent != other.field_1_wIdent )
+ return false;
+ if ( field_2_nFib != other.field_2_nFib )
+ return false;
+ if ( field_3_unused != other.field_3_unused )
+ return false;
+ if ( field_4_lid != other.field_4_lid )
+ return false;
+ if ( field_5_pnNext != other.field_5_pnNext )
+ return false;
+ if ( field_6_flags1 != other.field_6_flags1 )
+ return false;
+ if ( field_7_nFibBack != other.field_7_nFibBack )
+ return false;
+ if ( field_8_lKey != other.field_8_lKey )
+ return false;
+ if ( field_9_envr != other.field_9_envr )
+ return false;
+ return true;
+ }
+
+ @Override
+ @SuppressWarnings( "deprecation" )
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + field_10_flags2;
+ result = prime * result + field_11_Chs;
+ result = prime * result + field_12_chsTables;
+ result = prime * result + field_13_fcMin;
+ result = prime * result + field_14_fcMac;
+ result = prime * result + field_1_wIdent;
+ result = prime * result + field_2_nFib;
+ result = prime * result + field_3_unused;
+ result = prime * result + field_4_lid;
+ result = prime * result + field_5_pnNext;
+ result = prime * result + field_6_flags1;
+ result = prime * result + field_7_nFibBack;
+ result = prime * result + field_8_lKey;
+ result = prime * result + field_9_envr;
+ return result;
+ }
+
+}
import java.util.HashSet;
import org.apache.poi.hwpf.model.io.HWPFOutputStream;
-import org.apache.poi.hwpf.model.types.FIBAbstractType;
import org.apache.poi.util.Internal;
/**
* @author andy
*/
@Internal
-public final class FileInformationBlock extends FIBAbstractType
- implements Cloneable
+public final class FileInformationBlock implements Cloneable
{
+ private FibBase _fibBase;
+
FIBLongHandler _longHandler;
FIBShortHandler _shortHandler;
FIBFieldHandler _fieldHandler;
/** Creates a new instance of FileInformationBlock */
public FileInformationBlock(byte[] mainDocument)
{
- fillFields(mainDocument, 0);
+ _fibBase = new FibBase(mainDocument, 0);
}
public void fillVariableFields( byte[] mainDocument, byte[] tableStream )
@Override
public String toString()
{
- StringBuilder stringBuilder = new StringBuilder( super.toString() );
+ StringBuilder stringBuilder = new StringBuilder( );
+ stringBuilder.append( _fibBase );
stringBuilder.append( "[FIB2]\n" );
stringBuilder.append( "\tSubdocuments info:\n" );
for ( SubdocumentType type : SubdocumentType.values() )
offset );
}
- public void writeTo( byte[] mainStream, HWPFOutputStream tableStream)
- throws IOException
+ public void writeTo( byte[] mainStream, HWPFOutputStream tableStream )
+ throws IOException
{
- //HWPFOutputStream mainDocument = sys.getStream("WordDocument");
- //HWPFOutputStream tableStream = sys.getStream("1Table");
+ // HWPFOutputStream mainDocument = sys.getStream("WordDocument");
+ // HWPFOutputStream tableStream = sys.getStream("1Table");
+
+ _fibBase.serialize( mainStream, 0 );
+ int offset = FibBase.getSize();
- super.serialize(mainStream, 0);
+ _shortHandler.serialize( mainStream );
+ offset += _shortHandler.sizeInBytes();
- int size = super.getSize();
- _shortHandler.serialize(mainStream);
- _longHandler.serialize(mainStream, size + _shortHandler.sizeInBytes());
- _fieldHandler.writeTo(mainStream,
- super.getSize() + _shortHandler.sizeInBytes() + _longHandler.sizeInBytes(), tableStream);
+ _longHandler.serialize( mainStream, offset );
+ offset += _longHandler.sizeInBytes();
+ _fieldHandler.writeTo( mainStream, offset, tableStream );
}
public int getSize()
{
- return super.getSize() + _shortHandler.sizeInBytes() +
- _longHandler.sizeInBytes() + _fieldHandler.sizeInBytes();
- }
-// public Object clone()
-// {
-// try
-// {
-// return super.clone();
-// }
-// catch (CloneNotSupportedException e)
-// {
-// e.printStackTrace();
-// return null;
-// }
-// }
+ return FibBase.getSize() + _shortHandler.sizeInBytes()
+ + _longHandler.sizeInBytes() + _fieldHandler.sizeInBytes();
+ }
+ public FibBase getFibBase()
+ {
+ return _fibBase;
+ }
}
+++ /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.types;
-
-
-import org.apache.poi.hdf.model.hdftypes.HDFType;
-import org.apache.poi.util.BitField;
-import org.apache.poi.util.BitFieldFactory;
-import org.apache.poi.util.Internal;
-import org.apache.poi.util.LittleEndian;
-
-/**
- * Base part of the File information Block (FibBase). Holds the core part of the FIB, from the first 32 bytes.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
- *
- * @author Andrew C. Oliver
- */
-@Internal
-public abstract class FIBAbstractType implements HDFType {
-
- protected int field_1_wIdent;
- protected int field_2_nFib;
- protected int field_3_nProduct;
- protected int field_4_lid;
- protected int field_5_pnNext;
- protected short field_6_options;
- private static BitField fDot = BitFieldFactory.getInstance(0x0001);
- private static BitField fGlsy = BitFieldFactory.getInstance(0x0002);
- private static BitField fComplex = BitFieldFactory.getInstance(0x0004);
- private static BitField fHasPic = BitFieldFactory.getInstance(0x0008);
- private static BitField cQuickSaves = BitFieldFactory.getInstance(0x00F0);
- private static BitField fEncrypted = BitFieldFactory.getInstance(0x0100);
- private static BitField fWhichTblStm = BitFieldFactory.getInstance(0x0200);
- private static BitField fReadOnlyRecommended = BitFieldFactory.getInstance(0x0400);
- private static BitField fWriteReservation = BitFieldFactory.getInstance(0x0800);
- private static BitField fExtChar = BitFieldFactory.getInstance(0x1000);
- private static BitField fLoadOverride = BitFieldFactory.getInstance(0x2000);
- private static BitField fFarEast = BitFieldFactory.getInstance(0x4000);
- private static BitField fCrypto = BitFieldFactory.getInstance(0x8000);
- protected int field_7_nFibBack;
- protected int field_8_lKey;
- protected int field_9_envr;
- protected short field_10_history;
- private static BitField fMac = BitFieldFactory.getInstance(0x0001);
- private static BitField fEmptySpecial = BitFieldFactory.getInstance(0x0002);
- private static BitField fLoadOverridePage = BitFieldFactory.getInstance(0x0004);
- private static BitField fFutureSavedUndo = BitFieldFactory.getInstance(0x0008);
- private static BitField fWord97Saved = BitFieldFactory.getInstance(0x0010);
- private static BitField fSpare0 = BitFieldFactory.getInstance(0x00FE);
- protected int field_11_chs; /** Latest docs say this is Reserved3! */
- protected int field_12_chsTables; /** Latest docs say this is Reserved4! */
- protected int field_13_fcMin; /** Latest docs say this is Reserved5! */
- protected int field_14_fcMac; /** Latest docs say this is Reserved6! */
-
-
- public FIBAbstractType()
- {
-
- }
-
- protected void fillFields(byte [] data, int offset)
- {
- field_1_wIdent = LittleEndian.getShort(data, 0x0 + offset);
- field_2_nFib = LittleEndian.getShort(data, 0x2 + offset);
- field_3_nProduct = LittleEndian.getShort(data, 0x4 + offset);
- field_4_lid = LittleEndian.getShort(data, 0x6 + offset);
- field_5_pnNext = LittleEndian.getShort(data, 0x8 + offset);
- field_6_options = LittleEndian.getShort(data, 0xa + offset);
- field_7_nFibBack = LittleEndian.getShort(data, 0xc + offset);
- field_8_lKey = LittleEndian.getShort(data, 0xe + offset);
- field_9_envr = LittleEndian.getShort(data, 0x10 + offset);
- field_10_history = LittleEndian.getShort(data, 0x12 + offset);
- field_11_chs = LittleEndian.getShort(data, 0x14 + offset);
- field_12_chsTables = LittleEndian.getShort(data, 0x16 + offset);
- field_13_fcMin = LittleEndian.getInt(data, 0x18 + offset);
- field_14_fcMac = LittleEndian.getInt(data, 0x1c + offset);
- }
-
- public void serialize(byte[] data, int offset)
- {
- LittleEndian.putShort(data, 0x0 + offset, (short)field_1_wIdent);
- LittleEndian.putShort(data, 0x2 + offset, (short)field_2_nFib);
- LittleEndian.putShort(data, 0x4 + offset, (short)field_3_nProduct);
- LittleEndian.putShort(data, 0x6 + offset, (short)field_4_lid);
- LittleEndian.putShort(data, 0x8 + offset, (short)field_5_pnNext);
- LittleEndian.putShort(data, 0xa + offset, field_6_options);
- LittleEndian.putShort(data, 0xc + offset, (short)field_7_nFibBack);
- LittleEndian.putShort(data, 0xe + offset, (short)field_8_lKey);
- LittleEndian.putShort(data, 0x10 + offset, (short)field_9_envr);
- LittleEndian.putShort(data, 0x12 + offset, field_10_history);
- LittleEndian.putShort(data, 0x14 + offset, (short)field_11_chs);
- LittleEndian.putShort(data, 0x16 + offset, (short)field_12_chsTables);
- LittleEndian.putInt(data, 0x18 + offset, field_13_fcMin);
- LittleEndian.putInt(data, 0x1c + offset, field_14_fcMac);
- }
-
- public String toString()
- {
- StringBuffer buffer = new StringBuffer();
-
- buffer.append("[FIB]\n");
-
- buffer.append(" .wIdent = ");
- buffer.append(" (").append(getWIdent()).append(" )\n");
-
- buffer.append(" .nFib = ");
- buffer.append(" (").append(getNFib()).append(" )\n");
-
- buffer.append(" .nProduct = ");
- buffer.append(" (").append(getNProduct()).append(" )\n");
-
- buffer.append(" .lid = ");
- buffer.append(" (").append(getLid()).append(" )\n");
-
- buffer.append(" .pnNext = ");
- buffer.append(" (").append(getPnNext()).append(" )\n");
-
- buffer.append(" .options = ");
- buffer.append(" (").append(getOptions()).append(" )\n");
- buffer.append(" .fDot = ").append(isFDot()).append('\n');
- buffer.append(" .fGlsy = ").append(isFGlsy()).append('\n');
- buffer.append(" .fComplex = ").append(isFComplex()).append('\n');
- buffer.append(" .fHasPic = ").append(isFHasPic()).append('\n');
- buffer.append(" .cQuickSaves = ").append(getCQuickSaves()).append('\n');
- buffer.append(" .fEncrypted = ").append(isFEncrypted()).append('\n');
- buffer.append(" .fWhichTblStm = ").append(isFWhichTblStm()).append('\n');
- buffer.append(" .fReadOnlyRecommended = ").append(isFReadOnlyRecommended()).append('\n');
- buffer.append(" .fWriteReservation = ").append(isFWriteReservation()).append('\n');
- buffer.append(" .fExtChar = ").append(isFExtChar()).append('\n');
- buffer.append(" .fLoadOverride = ").append(isFLoadOverride()).append('\n');
- buffer.append(" .fFarEast = ").append(isFFarEast()).append('\n');
- buffer.append(" .fCrypto = ").append(isFCrypto()).append('\n');
-
- buffer.append(" .nFibBack = ");
- buffer.append(" (").append(getNFibBack()).append(" )\n");
-
- buffer.append(" .lKey = ");
- buffer.append(" (").append(getLKey()).append(" )\n");
-
- buffer.append(" .envr = ");
- buffer.append(" (").append(getEnvr()).append(" )\n");
-
- buffer.append(" .history = ");
- buffer.append(" (").append(getHistory()).append(" )\n");
- buffer.append(" .fMac = ").append(isFMac()).append('\n');
- buffer.append(" .fEmptySpecial = ").append(isFEmptySpecial()).append('\n');
- buffer.append(" .fLoadOverridePage = ").append(isFLoadOverridePage()).append('\n');
- buffer.append(" .fFutureSavedUndo = ").append(isFFutureSavedUndo()).append('\n');
- buffer.append(" .fWord97Saved = ").append(isFWord97Saved()).append('\n');
- buffer.append(" .fSpare0 = ").append(getFSpare0()).append('\n');
-
- buffer.append(" .chs = ");
- buffer.append(" (").append(getChs()).append(" )\n");
-
- buffer.append(" .chsTables = ");
- buffer.append(" (").append(getChsTables()).append(" )\n");
-
- buffer.append(" .fcMin = ");
- buffer.append(" (").append(getFcMin()).append(" )\n");
-
- buffer.append(" .fcMac = ");
- buffer.append(" (").append(getFcMac()).append(" )\n");
-
- buffer.append("[/FIB]\n");
- return buffer.toString();
- }
-
- /**
- * Size of record (exluding 4 byte header)
- */
- public int getSize()
- {
- return 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4 + 4;
- }
-
-
-
- /**
- * Get the wIdent field for the FIB record.
- */
- public int getWIdent()
- {
- return field_1_wIdent;
- }
-
- /**
- * Set the wIdent field for the FIB record.
- */
- public void setWIdent(int field_1_wIdent)
- {
- this.field_1_wIdent = field_1_wIdent;
- }
-
- /**
- * Get the nFib field for the FIB record.
- */
- public int getNFib()
- {
- return field_2_nFib;
- }
-
- /**
- * Set the nFib field for the FIB record.
- */
- public void setNFib(int field_2_nFib)
- {
- this.field_2_nFib = field_2_nFib;
- }
-
- /**
- * Get the nProduct field for the FIB record.
- */
- public int getNProduct()
- {
- return field_3_nProduct;
- }
-
- /**
- * Set the nProduct field for the FIB record.
- */
- public void setNProduct(int field_3_nProduct)
- {
- this.field_3_nProduct = field_3_nProduct;
- }
-
- /**
- * Get the lid field for the FIB record.
- */
- public int getLid()
- {
- return field_4_lid;
- }
-
- /**
- * Set the lid field for the FIB record.
- */
- public void setLid(int field_4_lid)
- {
- this.field_4_lid = field_4_lid;
- }
-
- /**
- * Get the pnNext field for the FIB record.
- */
- public int getPnNext()
- {
- return field_5_pnNext;
- }
-
- /**
- * Set the pnNext field for the FIB record.
- */
- public void setPnNext(int field_5_pnNext)
- {
- this.field_5_pnNext = field_5_pnNext;
- }
-
- /**
- * Get the options field for the FIB record.
- */
- public short getOptions()
- {
- return field_6_options;
- }
-
- /**
- * Set the options field for the FIB record.
- */
- public void setOptions(short field_6_options)
- {
- this.field_6_options = field_6_options;
- }
-
- /**
- * Get the nFibBack field for the FIB record.
- */
- public int getNFibBack()
- {
- return field_7_nFibBack;
- }
-
- /**
- * Set the nFibBack field for the FIB record.
- */
- public void setNFibBack(int field_7_nFibBack)
- {
- this.field_7_nFibBack = field_7_nFibBack;
- }
-
- /**
- * Get the lKey field for the FIB record.
- */
- public int getLKey()
- {
- return field_8_lKey;
- }
-
- /**
- * Set the lKey field for the FIB record.
- */
- public void setLKey(int field_8_lKey)
- {
- this.field_8_lKey = field_8_lKey;
- }
-
- /**
- * Get the envr field for the FIB record.
- */
- public int getEnvr()
- {
- return field_9_envr;
- }
-
- /**
- * Set the envr field for the FIB record.
- */
- public void setEnvr(int field_9_envr)
- {
- this.field_9_envr = field_9_envr;
- }
-
- /**
- * Get the history field for the FIB record.
- */
- public short getHistory()
- {
- return field_10_history;
- }
-
- /**
- * Set the history field for the FIB record.
- */
- public void setHistory(short field_10_history)
- {
- this.field_10_history = field_10_history;
- }
-
- /**
- * Get the chs field for the FIB record.
- */
- public int getChs()
- {
- return field_11_chs;
- }
-
- /**
- * Set the chs field for the FIB record.
- */
- public void setChs(int field_11_chs)
- {
- this.field_11_chs = field_11_chs;
- }
-
- /**
- * Get the chsTables field for the FIB record.
- */
- public int getChsTables()
- {
- return field_12_chsTables;
- }
-
- /**
- * Set the chsTables field for the FIB record.
- */
- public void setChsTables(int field_12_chsTables)
- {
- this.field_12_chsTables = field_12_chsTables;
- }
-
- /**
- * Get the fcMin field for the FIB record.
- */
- public int getFcMin()
- {
- return field_13_fcMin;
- }
-
- /**
- * Set the fcMin field for the FIB record.
- */
- public void setFcMin(int field_13_fcMin)
- {
- this.field_13_fcMin = field_13_fcMin;
- }
-
- /**
- * Get the fcMac field for the FIB record.
- */
- public int getFcMac()
- {
- return field_14_fcMac;
- }
-
- /**
- * Set the fcMac field for the FIB record.
- */
- public void setFcMac(int field_14_fcMac)
- {
- this.field_14_fcMac = field_14_fcMac;
- }
-
- /**
- * Sets the fDot field value.
- *
- */
- public void setFDot(boolean value)
- {
- field_6_options = (short)fDot.setBoolean(field_6_options, value);
- }
-
- /**
- *
- * @return the fDot field value.
- */
- public boolean isFDot()
- {
- return fDot.isSet(field_6_options);
- }
-
- /**
- * Sets the fGlsy field value.
- *
- */
- public void setFGlsy(boolean value)
- {
- field_6_options = (short)fGlsy.setBoolean(field_6_options, value);
- }
-
- /**
- *
- * @return the fGlsy field value.
- */
- public boolean isFGlsy()
- {
- return fGlsy.isSet(field_6_options);
- }
-
- /**
- * Sets the fComplex field value.
- *
- */
- public void setFComplex(boolean value)
- {
- field_6_options = (short)fComplex.setBoolean(field_6_options, value);
- }
-
- /**
- *
- * @return the fComplex field value.
- */
- public boolean isFComplex()
- {
- return fComplex.isSet(field_6_options);
- }
-
- /**
- * Sets the fHasPic field value.
- *
- */
- public void setFHasPic(boolean value)
- {
- field_6_options = (short)fHasPic.setBoolean(field_6_options, value);
- }
-
- /**
- *
- * @return the fHasPic field value.
- */
- public boolean isFHasPic()
- {
- return fHasPic.isSet(field_6_options);
- }
-
- /**
- * Sets the cQuickSaves field value.
- *
- */
- public void setCQuickSaves(byte value)
- {
- field_6_options = (short)cQuickSaves.setValue(field_6_options, value);
- }
-
- /**
- *
- * @return the cQuickSaves field value.
- */
- public byte getCQuickSaves()
- {
- return ( byte )cQuickSaves.getValue(field_6_options);
- }
-
- /**
- * Sets the fEncrypted field value.
- *
- */
- public void setFEncrypted(boolean value)
- {
- field_6_options = (short)fEncrypted.setBoolean(field_6_options, value);
- }
-
- /**
- *
- * @return the fEncrypted field value.
- */
- public boolean isFEncrypted()
- {
- return fEncrypted.isSet(field_6_options);
- }
-
- /**
- * Sets the fWhichTblStm field value.
- *
- */
- public void setFWhichTblStm(boolean value)
- {
- field_6_options = (short)fWhichTblStm.setBoolean(field_6_options, value);
- }
-
- /**
- *
- * @return the fWhichTblStm field value.
- */
- public boolean isFWhichTblStm()
- {
- return fWhichTblStm.isSet(field_6_options);
- }
-
- /**
- * Sets the fReadOnlyRecommended field value.
- *
- */
- public void setFReadOnlyRecommended(boolean value)
- {
- field_6_options = (short)fReadOnlyRecommended.setBoolean(field_6_options, value);
- }
-
- /**
- *
- * @return the fReadOnlyRecommended field value.
- */
- public boolean isFReadOnlyRecommended()
- {
- return fReadOnlyRecommended.isSet(field_6_options);
- }
-
- /**
- * Sets the fWriteReservation field value.
- *
- */
- public void setFWriteReservation(boolean value)
- {
- field_6_options = (short)fWriteReservation.setBoolean(field_6_options, value);
- }
-
- /**
- *
- * @return the fWriteReservation field value.
- */
- public boolean isFWriteReservation()
- {
- return fWriteReservation.isSet(field_6_options);
- }
-
- /**
- * Sets the fExtChar field value.
- *
- */
- public void setFExtChar(boolean value)
- {
- field_6_options = (short)fExtChar.setBoolean(field_6_options, value);
- }
-
- /**
- *
- * @return the fExtChar field value.
- */
- public boolean isFExtChar()
- {
- return fExtChar.isSet(field_6_options);
- }
-
- /**
- * Sets the fLoadOverride field value.
- *
- */
- public void setFLoadOverride(boolean value)
- {
- field_6_options = (short)fLoadOverride.setBoolean(field_6_options, value);
- }
-
- /**
- *
- * @return the fLoadOverride field value.
- */
- public boolean isFLoadOverride()
- {
- return fLoadOverride.isSet(field_6_options);
- }
-
- /**
- * Sets the fFarEast field value.
- *
- */
- public void setFFarEast(boolean value)
- {
- field_6_options = (short)fFarEast.setBoolean(field_6_options, value);
- }
-
- /**
- *
- * @return the fFarEast field value.
- */
- public boolean isFFarEast()
- {
- return fFarEast.isSet(field_6_options);
- }
-
- /**
- * Sets the fCrypto field value.
- *
- */
- public void setFCrypto(boolean value)
- {
- field_6_options = (short)fCrypto.setBoolean(field_6_options, value);
- }
-
- /**
- *
- * @return the fCrypto field value.
- */
- public boolean isFCrypto()
- {
- return fCrypto.isSet(field_6_options);
- }
-
- /**
- * Sets the fMac field value.
- *
- */
- public void setFMac(boolean value)
- {
- field_10_history = (short)fMac.setBoolean(field_10_history, value);
- }
-
- /**
- *
- * @return the fMac field value.
- */
- public boolean isFMac()
- {
- return fMac.isSet(field_10_history);
- }
-
- /**
- * Sets the fEmptySpecial field value.
- *
- */
- public void setFEmptySpecial(boolean value)
- {
- field_10_history = (short)fEmptySpecial.setBoolean(field_10_history, value);
- }
-
- /**
- *
- * @return the fEmptySpecial field value.
- */
- public boolean isFEmptySpecial()
- {
- return fEmptySpecial.isSet(field_10_history);
- }
-
- /**
- * Sets the fLoadOverridePage field value.
- *
- */
- public void setFLoadOverridePage(boolean value)
- {
- field_10_history = (short)fLoadOverridePage.setBoolean(field_10_history, value);
- }
-
- /**
- *
- * @return the fLoadOverridePage field value.
- */
- public boolean isFLoadOverridePage()
- {
- return fLoadOverridePage.isSet(field_10_history);
- }
-
- /**
- * Sets the fFutureSavedUndo field value.
- *
- */
- public void setFFutureSavedUndo(boolean value)
- {
- field_10_history = (short)fFutureSavedUndo.setBoolean(field_10_history, value);
- }
-
- /**
- *
- * @return the fFutureSavedUndo field value.
- */
- public boolean isFFutureSavedUndo()
- {
- return fFutureSavedUndo.isSet(field_10_history);
- }
-
- /**
- * Sets the fWord97Saved field value.
- *
- */
- public void setFWord97Saved(boolean value)
- {
- field_10_history = (short)fWord97Saved.setBoolean(field_10_history, value);
- }
-
- /**
- *
- * @return the fWord97Saved field value.
- */
- public boolean isFWord97Saved()
- {
- return fWord97Saved.isSet(field_10_history);
- }
-
- /**
- * Sets the fSpare0 field value.
- *
- */
- public void setFSpare0(byte value)
- {
- field_10_history = (short)fSpare0.setValue(field_10_history, value);
- }
-
- /**
- *
- * @return the fSpare0 field value.
- */
- public byte getFSpare0()
- {
- return ( byte )fSpare0.getValue(field_10_history);
- }
-}
--- /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
+\r
+package org.apache.poi.hwpf.model.types;\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
+ * Base part of the File information Block (FibBase). Holds the core part of the FIB,\r
+ from the first 32 bytes. <p>Class and fields descriptions are quoted from Microsoft\r
+ Office Word 97-2007 Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File\r
+ 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 Andrew C. Oliver; Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary\r
+ File Format Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format\r
+ \r
+ */\r
+@Internal\r
+public abstract class FibBaseAbstractType\r
+{\r
+\r
+ protected int field_1_wIdent;\r
+ protected int field_2_nFib;\r
+ protected int field_3_unused;\r
+ protected int field_4_lid;\r
+ protected int field_5_pnNext;\r
+ protected short field_6_flags1;\r
+ /**/private static final BitField fDot = new BitField(0x0001);\r
+ /**/private static final BitField fGlsy = new BitField(0x0002);\r
+ /**/private static final BitField fComplex = new BitField(0x0004);\r
+ /**/private static final BitField fHasPic = new BitField(0x0008);\r
+ /**/private static final BitField cQuickSaves = new BitField(0x00F0);\r
+ /**/private static final BitField fEncrypted = new BitField(0x0100);\r
+ /**/private static final BitField fWhichTblStm = new BitField(0x0200);\r
+ /**/private static final BitField fReadOnlyRecommended = new BitField(0x0400);\r
+ /**/private static final BitField fWriteReservation = new BitField(0x0800);\r
+ /**/private static final BitField fExtChar = new BitField(0x1000);\r
+ /**/private static final BitField fLoadOverride = new BitField(0x2000);\r
+ /**/private static final BitField fFarEast = new BitField(0x4000);\r
+ /**/private static final BitField fObfuscated = new BitField(0x8000);\r
+ protected int field_7_nFibBack;\r
+ protected int field_8_lKey;\r
+ @Deprecated\r
+ protected byte field_9_envr;\r
+ protected byte field_10_flags2;\r
+ /**/private static final BitField fMac = new BitField(0x01);\r
+ /**/private static final BitField fEmptySpecial = new BitField(0x02);\r
+ /**/private static final BitField fLoadOverridePage = new BitField(0x04);\r
+ /**/private static final BitField reserved1 = new BitField(0x08);\r
+ /**/private static final BitField reserved2 = new BitField(0x10);\r
+ /**/private static final BitField fSpare0 = new BitField(0xFE);\r
+ @Deprecated\r
+ protected short field_11_Chs;\r
+ @Deprecated\r
+ protected short field_12_chsTables;\r
+ @Deprecated\r
+ protected int field_13_fcMin;\r
+ @Deprecated\r
+ protected int field_14_fcMac;\r
+\r
+ protected FibBaseAbstractType()\r
+ {\r
+ }\r
+\r
+ protected void fillFields( byte[] data, int offset )\r
+ {\r
+ field_1_wIdent = LittleEndian.getShort( data, 0x0 + offset );\r
+ field_2_nFib = LittleEndian.getShort( data, 0x2 + offset );\r
+ field_3_unused = LittleEndian.getShort( data, 0x4 + offset );\r
+ field_4_lid = LittleEndian.getShort( data, 0x6 + offset );\r
+ field_5_pnNext = LittleEndian.getShort( data, 0x8 + offset );\r
+ field_6_flags1 = LittleEndian.getShort( data, 0xa + offset );\r
+ field_7_nFibBack = LittleEndian.getShort( data, 0xc + offset );\r
+ field_8_lKey = LittleEndian.getInt( data, 0xe + offset );\r
+ field_9_envr = data[ 0x12 + offset ];\r
+ field_10_flags2 = data[ 0x13 + offset ];\r
+ field_11_Chs = LittleEndian.getShort( data, 0x14 + offset );\r
+ field_12_chsTables = LittleEndian.getShort( data, 0x16 + offset );\r
+ field_13_fcMin = LittleEndian.getInt( data, 0x18 + offset );\r
+ field_14_fcMac = LittleEndian.getInt( data, 0x1c + offset );\r
+ }\r
+\r
+ public void serialize( byte[] data, int offset )\r
+ {\r
+ LittleEndian.putUShort( data, 0x0 + offset, field_1_wIdent );\r
+ LittleEndian.putUShort( data, 0x2 + offset, field_2_nFib );\r
+ LittleEndian.putUShort( data, 0x4 + offset, field_3_unused );\r
+ LittleEndian.putUShort( data, 0x6 + offset, field_4_lid );\r
+ LittleEndian.putUShort( data, 0x8 + offset, field_5_pnNext );\r
+ LittleEndian.putShort( data, 0xa + offset, field_6_flags1 );\r
+ LittleEndian.putUShort( data, 0xc + offset, field_7_nFibBack );\r
+ LittleEndian.putInt( data, 0xe + offset, field_8_lKey );\r
+ data[ 0x12 + offset ] = field_9_envr;\r
+ data[ 0x13 + offset ] = field_10_flags2;\r
+ LittleEndian.putShort( data, 0x14 + offset, field_11_Chs );\r
+ LittleEndian.putShort( data, 0x16 + offset, field_12_chsTables );\r
+ LittleEndian.putInt( data, 0x18 + offset, field_13_fcMin );\r
+ LittleEndian.putInt( data, 0x1c + offset, field_14_fcMac );\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 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4 + 1 + 1 + 2 + 2 + 4 + 4;\r
+ }\r
+\r
+ public String toString()\r
+ {\r
+ StringBuilder builder = new StringBuilder();\r
+ builder.append("[FibBase]\n");\r
+ builder.append(" .wIdent = ");\r
+ builder.append(" (").append(getWIdent()).append(" )\n");\r
+ builder.append(" .nFib = ");\r
+ builder.append(" (").append(getNFib()).append(" )\n");\r
+ builder.append(" .unused = ");\r
+ builder.append(" (").append(getUnused()).append(" )\n");\r
+ builder.append(" .lid = ");\r
+ builder.append(" (").append(getLid()).append(" )\n");\r
+ builder.append(" .pnNext = ");\r
+ builder.append(" (").append(getPnNext()).append(" )\n");\r
+ builder.append(" .flags1 = ");\r
+ builder.append(" (").append(getFlags1()).append(" )\n");\r
+ builder.append(" .fDot = ").append(isFDot()).append('\n');\r
+ builder.append(" .fGlsy = ").append(isFGlsy()).append('\n');\r
+ builder.append(" .fComplex = ").append(isFComplex()).append('\n');\r
+ builder.append(" .fHasPic = ").append(isFHasPic()).append('\n');\r
+ builder.append(" .cQuickSaves = ").append(getCQuickSaves()).append('\n');\r
+ builder.append(" .fEncrypted = ").append(isFEncrypted()).append('\n');\r
+ builder.append(" .fWhichTblStm = ").append(isFWhichTblStm()).append('\n');\r
+ builder.append(" .fReadOnlyRecommended = ").append(isFReadOnlyRecommended()).append('\n');\r
+ builder.append(" .fWriteReservation = ").append(isFWriteReservation()).append('\n');\r
+ builder.append(" .fExtChar = ").append(isFExtChar()).append('\n');\r
+ builder.append(" .fLoadOverride = ").append(isFLoadOverride()).append('\n');\r
+ builder.append(" .fFarEast = ").append(isFFarEast()).append('\n');\r
+ builder.append(" .fObfuscated = ").append(isFObfuscated()).append('\n');\r
+ builder.append(" .nFibBack = ");\r
+ builder.append(" (").append(getNFibBack()).append(" )\n");\r
+ builder.append(" .lKey = ");\r
+ builder.append(" (").append(getLKey()).append(" )\n");\r
+ builder.append(" .envr = ");\r
+ builder.append(" (").append(getEnvr()).append(" )\n");\r
+ builder.append(" .flags2 = ");\r
+ builder.append(" (").append(getFlags2()).append(" )\n");\r
+ builder.append(" .fMac = ").append(isFMac()).append('\n');\r
+ builder.append(" .fEmptySpecial = ").append(isFEmptySpecial()).append('\n');\r
+ builder.append(" .fLoadOverridePage = ").append(isFLoadOverridePage()).append('\n');\r
+ builder.append(" .reserved1 = ").append(isReserved1()).append('\n');\r
+ builder.append(" .reserved2 = ").append(isReserved2()).append('\n');\r
+ builder.append(" .fSpare0 = ").append(getFSpare0()).append('\n');\r
+ builder.append(" .Chs = ");\r
+ builder.append(" (").append(getChs()).append(" )\n");\r
+ builder.append(" .chsTables = ");\r
+ builder.append(" (").append(getChsTables()).append(" )\n");\r
+ builder.append(" .fcMin = ");\r
+ builder.append(" (").append(getFcMin()).append(" )\n");\r
+ builder.append(" .fcMac = ");\r
+ builder.append(" (").append(getFcMac()).append(" )\n");\r
+\r
+ builder.append("[/FibBase]\n");\r
+ return builder.toString();\r
+ }\r
+\r
+ /**\r
+ * An unsigned integer that specifies that this is a Word Binary File. This value MUST be 0xA5EC.\r
+ */\r
+ @Internal\r
+ public int getWIdent()\r
+ {\r
+ return field_1_wIdent;\r
+ }\r
+\r
+ /**\r
+ * An unsigned integer that specifies that this is a Word Binary File. This value MUST be 0xA5EC.\r
+ */\r
+ @Internal\r
+ public void setWIdent( int field_1_wIdent )\r
+ {\r
+ this.field_1_wIdent = field_1_wIdent;\r
+ }\r
+\r
+ /**\r
+ * An unsigned integer that specifies the version number of the file format used. Superseded by FibRgCswNew.nFibNew if it is present. This value SHOULD be 0x00C1.\r
+ */\r
+ @Internal\r
+ public int getNFib()\r
+ {\r
+ return field_2_nFib;\r
+ }\r
+\r
+ /**\r
+ * An unsigned integer that specifies the version number of the file format used. Superseded by FibRgCswNew.nFibNew if it is present. This value SHOULD be 0x00C1.\r
+ */\r
+ @Internal\r
+ public void setNFib( int field_2_nFib )\r
+ {\r
+ this.field_2_nFib = field_2_nFib;\r
+ }\r
+\r
+ /**\r
+ * This value is undefined and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public int getUnused()\r
+ {\r
+ return field_3_unused;\r
+ }\r
+\r
+ /**\r
+ * This value is undefined and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public void setUnused( int field_3_unused )\r
+ {\r
+ this.field_3_unused = field_3_unused;\r
+ }\r
+\r
+ /**\r
+ * A LID that specifies the install language of the application that is producing the document. If nFib is 0x00D9 or greater, then any East Asian install lid or any install lid with a base language of Spanish, German or French MUST be recorded as lidAmerican. If the nFib is 0x0101 or greater, then any install lid with a base language of Vietnamese, Thai, or Hindi MUST be recorded as lidAmerican..\r
+ */\r
+ @Internal\r
+ public int getLid()\r
+ {\r
+ return field_4_lid;\r
+ }\r
+\r
+ /**\r
+ * A LID that specifies the install language of the application that is producing the document. If nFib is 0x00D9 or greater, then any East Asian install lid or any install lid with a base language of Spanish, German or French MUST be recorded as lidAmerican. If the nFib is 0x0101 or greater, then any install lid with a base language of Vietnamese, Thai, or Hindi MUST be recorded as lidAmerican..\r
+ */\r
+ @Internal\r
+ public void setLid( int field_4_lid )\r
+ {\r
+ this.field_4_lid = field_4_lid;\r
+ }\r
+\r
+ /**\r
+ * An unsigned integer that specifies the offset in the WordDocument stream of the FIB for the document which contains all the AutoText items.\r
+ */\r
+ @Internal\r
+ public int getPnNext()\r
+ {\r
+ return field_5_pnNext;\r
+ }\r
+\r
+ /**\r
+ * An unsigned integer that specifies the offset in the WordDocument stream of the FIB for the document which contains all the AutoText items.\r
+ */\r
+ @Internal\r
+ public void setPnNext( int field_5_pnNext )\r
+ {\r
+ this.field_5_pnNext = field_5_pnNext;\r
+ }\r
+\r
+ /**\r
+ * Get the flags1 field for the FibBase record.\r
+ */\r
+ @Internal\r
+ public short getFlags1()\r
+ {\r
+ return field_6_flags1;\r
+ }\r
+\r
+ /**\r
+ * Set the flags1 field for the FibBase record.\r
+ */\r
+ @Internal\r
+ public void setFlags1( short field_6_flags1 )\r
+ {\r
+ this.field_6_flags1 = field_6_flags1;\r
+ }\r
+\r
+ /**\r
+ * This value SHOULD be 0x00BF. This value MUST be 0x00BF or 0x00C1.\r
+ */\r
+ @Internal\r
+ public int getNFibBack()\r
+ {\r
+ return field_7_nFibBack;\r
+ }\r
+\r
+ /**\r
+ * This value SHOULD be 0x00BF. This value MUST be 0x00BF or 0x00C1.\r
+ */\r
+ @Internal\r
+ public void setNFibBack( int field_7_nFibBack )\r
+ {\r
+ this.field_7_nFibBack = field_7_nFibBack;\r
+ }\r
+\r
+ /**\r
+ * If fEncryption is 1 and fObfuscation is 1, this value specifies the XOR obfuscation password verifier. If fEncryption is 1 and fObfuscation is 0, this value specifies the size of the EncryptionHeader that is stored at the beginning of the Table stream as described in Encryption and Obfuscation. Otherwise, this value MUST be 0.\r
+ */\r
+ @Internal\r
+ public int getLKey()\r
+ {\r
+ return field_8_lKey;\r
+ }\r
+\r
+ /**\r
+ * If fEncryption is 1 and fObfuscation is 1, this value specifies the XOR obfuscation password verifier. If fEncryption is 1 and fObfuscation is 0, this value specifies the size of the EncryptionHeader that is stored at the beginning of the Table stream as described in Encryption and Obfuscation. Otherwise, this value MUST be 0.\r
+ */\r
+ @Internal\r
+ public void setLKey( int field_8_lKey )\r
+ {\r
+ this.field_8_lKey = field_8_lKey;\r
+ }\r
+\r
+ /**\r
+ * This value MUST be 0, and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public byte getEnvr()\r
+ {\r
+ return field_9_envr;\r
+ }\r
+\r
+ /**\r
+ * This value MUST be 0, and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public void setEnvr( byte field_9_envr )\r
+ {\r
+ this.field_9_envr = field_9_envr;\r
+ }\r
+\r
+ /**\r
+ * Get the flags2 field for the FibBase record.\r
+ */\r
+ @Internal\r
+ public byte getFlags2()\r
+ {\r
+ return field_10_flags2;\r
+ }\r
+\r
+ /**\r
+ * Set the flags2 field for the FibBase record.\r
+ */\r
+ @Internal\r
+ public void setFlags2( byte field_10_flags2 )\r
+ {\r
+ this.field_10_flags2 = field_10_flags2;\r
+ }\r
+\r
+ /**\r
+ * This value MUST be 0 and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public short getChs()\r
+ {\r
+ return field_11_Chs;\r
+ }\r
+\r
+ /**\r
+ * This value MUST be 0 and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public void setChs( short field_11_Chs )\r
+ {\r
+ this.field_11_Chs = field_11_Chs;\r
+ }\r
+\r
+ /**\r
+ * This value MUST be 0 and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public short getChsTables()\r
+ {\r
+ return field_12_chsTables;\r
+ }\r
+\r
+ /**\r
+ * This value MUST be 0 and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public void setChsTables( short field_12_chsTables )\r
+ {\r
+ this.field_12_chsTables = field_12_chsTables;\r
+ }\r
+\r
+ /**\r
+ * This value is undefined and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public int getFcMin()\r
+ {\r
+ return field_13_fcMin;\r
+ }\r
+\r
+ /**\r
+ * This value is undefined and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public void setFcMin( int field_13_fcMin )\r
+ {\r
+ this.field_13_fcMin = field_13_fcMin;\r
+ }\r
+\r
+ /**\r
+ * This value is undefined and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public int getFcMac()\r
+ {\r
+ return field_14_fcMac;\r
+ }\r
+\r
+ /**\r
+ * This value is undefined and MUST be ignored.\r
+ */\r
+ @Internal\r
+ public void setFcMac( int field_14_fcMac )\r
+ {\r
+ this.field_14_fcMac = field_14_fcMac;\r
+ }\r
+\r
+ /**\r
+ * Sets the fDot field value.\r
+ * Specifies whether this is a document template\r
+ */\r
+ @Internal\r
+ public void setFDot( boolean value )\r
+ {\r
+ field_6_flags1 = (short)fDot.setBoolean(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * Specifies whether this is a document template\r
+ * @return the fDot field value.\r
+ */\r
+ @Internal\r
+ public boolean isFDot()\r
+ {\r
+ return fDot.isSet(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the fGlsy field value.\r
+ * Specifies whether this is a document that contains only AutoText items\r
+ */\r
+ @Internal\r
+ public void setFGlsy( boolean value )\r
+ {\r
+ field_6_flags1 = (short)fGlsy.setBoolean(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * Specifies whether this is a document that contains only AutoText items\r
+ * @return the fGlsy field value.\r
+ */\r
+ @Internal\r
+ public boolean isFGlsy()\r
+ {\r
+ return fGlsy.isSet(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the fComplex field value.\r
+ * Specifies that the last save operation that was performed on this document was an incremental save operation\r
+ */\r
+ @Internal\r
+ public void setFComplex( boolean value )\r
+ {\r
+ field_6_flags1 = (short)fComplex.setBoolean(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * Specifies that the last save operation that was performed on this document was an incremental save operation\r
+ * @return the fComplex field value.\r
+ */\r
+ @Internal\r
+ public boolean isFComplex()\r
+ {\r
+ return fComplex.isSet(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the fHasPic field value.\r
+ * When set to 0, there SHOULD be no pictures in the document\r
+ */\r
+ @Internal\r
+ public void setFHasPic( boolean value )\r
+ {\r
+ field_6_flags1 = (short)fHasPic.setBoolean(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * When set to 0, there SHOULD be no pictures in the document\r
+ * @return the fHasPic field value.\r
+ */\r
+ @Internal\r
+ public boolean isFHasPic()\r
+ {\r
+ return fHasPic.isSet(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the cQuickSaves field value.\r
+ * An unsigned integer. If nFib is less than 0x00D9, then cQuickSaves specifies the number of consecutive times this document was incrementally saved. If nFib is 0x00D9 or greater, then cQuickSaves MUST be 0xF\r
+ */\r
+ @Internal\r
+ public void setCQuickSaves( byte value )\r
+ {\r
+ field_6_flags1 = (short)cQuickSaves.setValue(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * An unsigned integer. If nFib is less than 0x00D9, then cQuickSaves specifies the number of consecutive times this document was incrementally saved. If nFib is 0x00D9 or greater, then cQuickSaves MUST be 0xF\r
+ * @return the cQuickSaves field value.\r
+ */\r
+ @Internal\r
+ public byte getCQuickSaves()\r
+ {\r
+ return ( byte )cQuickSaves.getValue(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the fEncrypted field value.\r
+ * Specifies whether the document is encrypted or obfuscated as specified in Encryption and Obfuscation\r
+ */\r
+ @Internal\r
+ public void setFEncrypted( boolean value )\r
+ {\r
+ field_6_flags1 = (short)fEncrypted.setBoolean(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * Specifies whether the document is encrypted or obfuscated as specified in Encryption and Obfuscation\r
+ * @return the fEncrypted field value.\r
+ */\r
+ @Internal\r
+ public boolean isFEncrypted()\r
+ {\r
+ return fEncrypted.isSet(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the fWhichTblStm field value.\r
+ * Specifies the Table stream to which the FIB refers. When this value is set to 1, use 1Table; when this value is set to 0, use 0Table.\r
+ */\r
+ @Internal\r
+ public void setFWhichTblStm( boolean value )\r
+ {\r
+ field_6_flags1 = (short)fWhichTblStm.setBoolean(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * Specifies the Table stream to which the FIB refers. When this value is set to 1, use 1Table; when this value is set to 0, use 0Table.\r
+ * @return the fWhichTblStm field value.\r
+ */\r
+ @Internal\r
+ public boolean isFWhichTblStm()\r
+ {\r
+ return fWhichTblStm.isSet(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the fReadOnlyRecommended field value.\r
+ * Specifies whether the document author recommended that the document be opened in read-only mode\r
+ */\r
+ @Internal\r
+ public void setFReadOnlyRecommended( boolean value )\r
+ {\r
+ field_6_flags1 = (short)fReadOnlyRecommended.setBoolean(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * Specifies whether the document author recommended that the document be opened in read-only mode\r
+ * @return the fReadOnlyRecommended field value.\r
+ */\r
+ @Internal\r
+ public boolean isFReadOnlyRecommended()\r
+ {\r
+ return fReadOnlyRecommended.isSet(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the fWriteReservation field value.\r
+ * Specifies whether the document has a write-reservation password\r
+ */\r
+ @Internal\r
+ public void setFWriteReservation( boolean value )\r
+ {\r
+ field_6_flags1 = (short)fWriteReservation.setBoolean(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * Specifies whether the document has a write-reservation password\r
+ * @return the fWriteReservation field value.\r
+ */\r
+ @Internal\r
+ public boolean isFWriteReservation()\r
+ {\r
+ return fWriteReservation.isSet(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the fExtChar field value.\r
+ * This value MUST be 1\r
+ */\r
+ @Internal\r
+ public void setFExtChar( boolean value )\r
+ {\r
+ field_6_flags1 = (short)fExtChar.setBoolean(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * This value MUST be 1\r
+ * @return the fExtChar field value.\r
+ */\r
+ @Internal\r
+ public boolean isFExtChar()\r
+ {\r
+ return fExtChar.isSet(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the fLoadOverride field value.\r
+ * Specifies whether to override the language information and font that are specified in the paragraph style at istd 0 (the normal style) with the defaults that are appropriate for the installation language of the application\r
+ */\r
+ @Internal\r
+ public void setFLoadOverride( boolean value )\r
+ {\r
+ field_6_flags1 = (short)fLoadOverride.setBoolean(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * Specifies whether to override the language information and font that are specified in the paragraph style at istd 0 (the normal style) with the defaults that are appropriate for the installation language of the application\r
+ * @return the fLoadOverride field value.\r
+ */\r
+ @Internal\r
+ public boolean isFLoadOverride()\r
+ {\r
+ return fLoadOverride.isSet(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the fFarEast field value.\r
+ * Specifies whether the installation language of the application that created the document was an East Asian language\r
+ */\r
+ @Internal\r
+ public void setFFarEast( boolean value )\r
+ {\r
+ field_6_flags1 = (short)fFarEast.setBoolean(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * Specifies whether the installation language of the application that created the document was an East Asian language\r
+ * @return the fFarEast field value.\r
+ */\r
+ @Internal\r
+ public boolean isFFarEast()\r
+ {\r
+ return fFarEast.isSet(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the fObfuscated field value.\r
+ * If fEncrypted is 1, this bit specifies whether the document is obfuscated by using XOR obfuscation; otherwise, this bit MUST be ignored\r
+ */\r
+ @Internal\r
+ public void setFObfuscated( boolean value )\r
+ {\r
+ field_6_flags1 = (short)fObfuscated.setBoolean(field_6_flags1, value);\r
+ }\r
+\r
+ /**\r
+ * If fEncrypted is 1, this bit specifies whether the document is obfuscated by using XOR obfuscation; otherwise, this bit MUST be ignored\r
+ * @return the fObfuscated field value.\r
+ */\r
+ @Internal\r
+ public boolean isFObfuscated()\r
+ {\r
+ return fObfuscated.isSet(field_6_flags1);\r
+ }\r
+\r
+ /**\r
+ * Sets the fMac field value.\r
+ * This value MUST be 0, and MUST be ignored\r
+ */\r
+ @Internal\r
+ public void setFMac( boolean value )\r
+ {\r
+ field_10_flags2 = (byte)fMac.setBoolean(field_10_flags2, value);\r
+ }\r
+\r
+ /**\r
+ * This value MUST be 0, and MUST be ignored\r
+ * @return the fMac field value.\r
+ * @deprecated This field should not be used according to specification\r
+ */\r
+ @Internal\r
+ @Deprecated\r
+ public boolean isFMac()\r
+ {\r
+ return fMac.isSet(field_10_flags2);\r
+ }\r
+\r
+ /**\r
+ * Sets the fEmptySpecial field value.\r
+ * This value SHOULD be 0 and SHOULD be ignored\r
+ */\r
+ @Internal\r
+ public void setFEmptySpecial( boolean value )\r
+ {\r
+ field_10_flags2 = (byte)fEmptySpecial.setBoolean(field_10_flags2, value);\r
+ }\r
+\r
+ /**\r
+ * This value SHOULD be 0 and SHOULD be ignored\r
+ * @return the fEmptySpecial field value.\r
+ * @deprecated This field should not be used according to specification\r
+ */\r
+ @Internal\r
+ @Deprecated\r
+ public boolean isFEmptySpecial()\r
+ {\r
+ return fEmptySpecial.isSet(field_10_flags2);\r
+ }\r
+\r
+ /**\r
+ * Sets the fLoadOverridePage field value.\r
+ * Specifies whether to override the section properties for page size, orientation, and margins with the defaults that are appropriate for the installation language of the application\r
+ */\r
+ @Internal\r
+ public void setFLoadOverridePage( boolean value )\r
+ {\r
+ field_10_flags2 = (byte)fLoadOverridePage.setBoolean(field_10_flags2, value);\r
+ }\r
+\r
+ /**\r
+ * Specifies whether to override the section properties for page size, orientation, and margins with the defaults that are appropriate for the installation language of the application\r
+ * @return the fLoadOverridePage field value.\r
+ */\r
+ @Internal\r
+ public boolean isFLoadOverridePage()\r
+ {\r
+ return fLoadOverridePage.isSet(field_10_flags2);\r
+ }\r
+\r
+ /**\r
+ * Sets the reserved1 field value.\r
+ * This value is undefined and MUST be ignored\r
+ */\r
+ @Internal\r
+ public void setReserved1( boolean value )\r
+ {\r
+ field_10_flags2 = (byte)reserved1.setBoolean(field_10_flags2, value);\r
+ }\r
+\r
+ /**\r
+ * This value is undefined 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 boolean isReserved1()\r
+ {\r
+ return reserved1.isSet(field_10_flags2);\r
+ }\r
+\r
+ /**\r
+ * Sets the reserved2 field value.\r
+ * This value is undefined and MUST be ignored\r
+ */\r
+ @Internal\r
+ public void setReserved2( boolean value )\r
+ {\r
+ field_10_flags2 = (byte)reserved2.setBoolean(field_10_flags2, value);\r
+ }\r
+\r
+ /**\r
+ * This value is undefined and MUST be ignored\r
+ * @return the reserved2 field value.\r
+ * @deprecated This field should not be used according to specification\r
+ */\r
+ @Internal\r
+ @Deprecated\r
+ public boolean isReserved2()\r
+ {\r
+ return reserved2.isSet(field_10_flags2);\r
+ }\r
+\r
+ /**\r
+ * Sets the fSpare0 field value.\r
+ * This value is undefined and MUST be ignored\r
+ */\r
+ @Internal\r
+ public void setFSpare0( byte value )\r
+ {\r
+ field_10_flags2 = (byte)fSpare0.setValue(field_10_flags2, value);\r
+ }\r
+\r
+ /**\r
+ * This value is undefined and MUST be ignored\r
+ * @return the fSpare0 field value.\r
+ * @deprecated This field should not be used according to specification\r
+ */\r
+ @Internal\r
+ @Deprecated\r
+ public byte getFSpare0()\r
+ {\r
+ return ( byte )fSpare0.getValue(field_10_flags2);\r
+ }\r
+\r
+} // END OF CLASS\r
_fib = new FileInformationBlock(_mainStream);
String name = "0Table";
- if (_fib.isFWhichTblStm())
+ if (_fib.getFibBase().isFWhichTblStm())
{
name = "1Table";
}
FileInformationBlock fib = _hWPFDocFixture._fib;
byte[] mainStream = _hWPFDocFixture._mainStream;
byte[] tableStream = _hWPFDocFixture._tableStream;
- int fcMin = fib.getFcMin();
+ int fcMin = fib.getFibBase().getFcMin();
_cHPBinTable = new CHPBinTable(mainStream, tableStream, fib.getFcPlcfbteChpx(), fib.getLcbPlcfbteChpx(), fakeTPT);
int size = _fileInformationBlock.getSize();
byte[] buf = new byte[size];
- _fileInformationBlock.serialize(buf, 0);
+ _fileInformationBlock.getFibBase().serialize(buf, 0);
FileInformationBlock newFileInformationBlock =
new FileInformationBlock(buf);
FileInformationBlock fib = _hWPFDocFixture._fib;
byte[] mainStream = _hWPFDocFixture._mainStream;
byte[] tableStream = _hWPFDocFixture._tableStream;
- int fcMin = fib.getFcMin();
+ int fcMin = fib.getFibBase().getFcMin();
CPSplitCalculator cps = new CPSplitCalculator(fib);
FileInformationBlock fib = _hWPFDocFixture._fib;
byte[] mainStream = _hWPFDocFixture._mainStream;
byte[] tableStream = _hWPFDocFixture._tableStream;
- int fcMin = fib.getFcMin();
+ int fcMin = fib.getFibBase().getFcMin();
ComplexFileTable cft = new ComplexFileTable(mainStream, tableStream, fib.getFcClx(), fcMin);
--- /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="FibBase" package="org.apache.poi.hwpf.model.types">
+ <suffix>AbstractType</suffix>
+ <description>Base part of the File information Block (FibBase). Holds the core part of the FIB,
+ from the first 32 bytes. <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>Andrew C. Oliver; 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="2" name="wIdent"
+ description="An unsigned integer that specifies that this is a Word Binary File. This value MUST be 0xA5EC"/>
+ <field type="int" size="2" name="nFib"
+ description="An unsigned integer that specifies the version number of the file format used. Superseded by FibRgCswNew.nFibNew if it is present. This value SHOULD be 0x00C1"/>
+ <field type="int" size="2" name="unused" description="This value is undefined and MUST be ignored"/>
+ <field type="int" size="2" name="lid"
+ description="A LID that specifies the install language of the application that is producing the document. If nFib is 0x00D9 or greater, then any East Asian install lid or any install lid with a base language of Spanish, German or French MUST be recorded as lidAmerican. If the nFib is 0x0101 or greater, then any install lid with a base language of Vietnamese, Thai, or Hindi MUST be recorded as lidAmerican."/>
+ <field type="int" size="2" name="pnNext"
+ description="An unsigned integer that specifies the offset in the WordDocument stream of the FIB for the document which contains all the AutoText items"/>
+ <field type="short" size="2" name="flags1">
+ <bit mask="0x0001" name="fDot" description="Specifies whether this is a document template"/>
+ <bit mask="0x0002" name="fGlsy"
+ description="Specifies whether this is a document that contains only AutoText items"/>
+ <bit mask="0x0004" name="fComplex"
+ description="Specifies that the last save operation that was performed on this document was an incremental save operation"/>
+ <bit mask="0x0008" name="fHasPic" description="When set to 0, there SHOULD be no pictures in the document"/>
+ <bit mask="0x00F0" name="cQuickSaves"
+ description="An unsigned integer. If nFib is less than 0x00D9, then cQuickSaves specifies the number of consecutive times this document was incrementally saved. If nFib is 0x00D9 or greater, then cQuickSaves MUST be 0xF"/>
+ <bit mask="0x0100" name="fEncrypted"
+ description="Specifies whether the document is encrypted or obfuscated as specified in Encryption and Obfuscation"/>
+ <bit mask="0x0200" name="fWhichTblStm"
+ description="Specifies the Table stream to which the FIB refers. When this value is set to 1, use 1Table; when this value is set to 0, use 0Table."/>
+ <bit mask="0x0400" name="fReadOnlyRecommended"
+ description="Specifies whether the document author recommended that the document be opened in read-only mode"/>
+ <bit mask="0x0800" name="fWriteReservation"
+ description="Specifies whether the document has a write-reservation password"/>
+ <bit mask="0x1000" name="fExtChar" description="This value MUST be 1"/>
+ <bit mask="0x2000" name="fLoadOverride"
+ description="Specifies whether to override the language information and font that are specified in the paragraph style at istd 0 (the normal style) with the defaults that are appropriate for the installation language of the application"/>
+ <bit mask="0x4000" name="fFarEast"
+ description="Specifies whether the installation language of the application that created the document was an East Asian language"/>
+ <bit mask="0x8000" name="fObfuscated"
+ description="If fEncrypted is 1, this bit specifies whether the document is obfuscated by using XOR obfuscation; otherwise, this bit MUST be ignored"/>
+ </field>
+ <field type="int" size="2" name="nFibBack"
+ description="This value SHOULD be 0x00BF. This value MUST be 0x00BF or 0x00C1"/>
+ <field type="int" size="4" name="lKey"
+ description="If fEncryption is 1 and fObfuscation is 1, this value specifies the XOR obfuscation password verifier. If fEncryption is 1 and fObfuscation is 0, this value specifies the size of the EncryptionHeader that is stored at the beginning of the Table stream as described in Encryption and Obfuscation. Otherwise, this value MUST be 0"/>
+ <field type="byte" size="1" name="envr" deprecated="true"
+ description="This value MUST be 0, and MUST be ignored"/>
+ <field type="byte" size="1" name="flags2">
+ <bit mask="0x01" name="fMac" deprecated="true" description="This value MUST be 0, and MUST be ignored"/>
+ <bit mask="0x02" name="fEmptySpecial" deprecated="true"
+ description="This value SHOULD be 0 and SHOULD be ignored"/>
+ <bit mask="0x04" name="fLoadOverridePage"
+ description="Specifies whether to override the section properties for page size, orientation, and margins with the defaults that are appropriate for the installation language of the application"/>
+ <bit mask="0x08" name="reserved1" deprecated="true"
+ description="This value is undefined and MUST be ignored"/>
+ <bit mask="0x10" name="reserved2" deprecated="true"
+ description="This value is undefined and MUST be ignored"/>
+ <bit mask="0xFE" name="fSpare0" deprecated="true"
+ description="This value is undefined and MUST be ignored"/>
+ </field>
+ <field type="short" size="2" name="Chs" deprecated="true"
+ description="This value MUST be 0 and MUST be ignored"/>
+ <field type="short" size="2" name="chsTables" deprecated="true"
+ description="This value MUST be 0 and MUST be ignored"/>
+ <field type="int" size="4" name="fcMin" deprecated="true"
+ description="This value is undefined and MUST be ignored"/>
+ <field type="int" size="4" name="fcMac" deprecated="true"
+ description="This value is undefined and MUST be ignored"/>
+ </fields>
+
+</record>
+++ /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="FIB" package="org.apache.poi.hwpf.model.types">
- <suffix>AbstractType</suffix>
- <extends>HDFType</extends>
- <description>Base part of the File information Block (FibBase). Holds the core part of the FIB, from the first 32 bytes.</description>
- <author>Andrew C. Oliver</author>
- <fields>
-<!-- <field type="int" size="2" name="format flags">
- <bit number="0" name="stacked" description="series is stacked"/>
- <bit number="1" name="display as percentage" description="results displayed as percentages"/>
- <bit number="2" name="shadow" description="display a shadow for the chart"/>
- </field>
- -->
- <field type="int" size="2" name="wIdent" longname="id"/>
- <field type="int" size="2" name="nFib" longname="version"/>
- <field type="int" size="2" name="nProduct" longname="product version"/>
- <field type="int" size="2" name="lid" longname="language stamp"/>
- <field type="int" size="2" name="pnNext" longname="unknown 0"/>
- <field type="short" size="2" name="options" longname="options">
- <bit number="0" mask="0x0001" name="fDot" longname="template"/>
- <bit number="1" mask="0x0002" name="fGlsy" longname="glossary"/>
- <bit number="2" mask="0x0004" name="fComplex" longname="quicksave"/>
- <bit number="3" mask="0x0008" name="fHasPic" longname="haspictr"/>
- <bit number="4" mask="0x00F0" name="cQuickSaves" longname="nquicksaves"/>
- <bit number="5" mask="0x0100" name="fEncrypted" longname="encrypted"/>
- <bit number="6" mask="0x0200" name="fWhichTblStm" longname="tabletype"/>
- <bit number="7" mask="0x0400" name="fReadOnlyRecommended" longname="readonly"/>
- <bit number="8" mask="0x0800" name="fWriteReservation" longname="writeReservation"/>
- <bit number="9" mask="0x1000" name="fExtChar" longname="extendedCharacter"/>
- <bit number="10" mask="0x2000" name="fLoadOverride" longname="loadOverride"/>
- <bit number="11" mask="0x4000" name="fFarEast" longname="farEast"/>
- <bit number="12" mask="0x8000" name="fCrypto" longname="crypto"/>
- </field>
- <field type="int" size="2" name="nFibBack" longname="minversion"/>
- <field type="int" size="2" name="lKey" longname="encrypted key"/>
- <field type="int" size="2" name="envr" longname="environment"/>
- <field type="short" size="2" name="history" longname="history">
- <bit number="0" mask="0x0001" name="fMac" longname="history mac"/>
- <bit number="1" mask="0x0002" name="fEmptySpecial" longname="empty special"/>
- <bit number="2" mask="0x0004" name="fLoadOverridePage" longname="load override hist"/>
- <bit number="3" mask="0x0008" name="fFutureSavedUndo" longname="feature undo"/>
- <bit number="4" mask="0x0010" name="fWord97Saved" longname="v97 saved"/>
- <bit number="5" mask="0x00FE" name="fSpare0" longname="spare"/>
- </field>
- <field type="int" size="2" name="chs" longname="default charset"/>
- <field type="int" size="2" name="chsTables" longname="default extcharset"/>
- <field type="int" size="4" name="fcMin" longname="offset first char"/>
- <field type="int" size="4" name="fcMac" longname="offset last char"/>
- <!--<field type="int" size="2" name="csw" longname="count shorts"/>
-
- <field type="int" size="2" name="wMagicCreated" longname="creator id or beg shorts"/>
- <field type="int" size="2" name="wMagicRevised" longname="revisor id"/>
- <field type="int" size="2" name="wMagicCreatedPrivate" longname="creator private"/>
- <field type="int" size="2" name="wMagicRevisedPrivate" longname="revisor private"/>
-
- <field type="int" size="2" name="pnFbpChpFirst_W6" longname="unused1"/>
- <field type="int" size="2" name="pnChpFirst_W6" longname="unused2"/>
- <field type="int" size="2" name="cpnBteChp_W6" longname="unused3"/>
- <field type="int" size="2" name="pnFbpPapFirst_W6" longname="unused4"/>
- <field type="int" size="2" name="pnPapFirst_W6" longname="unused5"/>
- <field type="int" size="2" name="cpnBtePap_W6" longname="unused6"/>
- <field type="int" size="2" name="pnFbpLvcFirst_W6" longname="unused7"/>
- <field type="int" size="2" name="pnLvcFirst_W6" longname="unused8"/>
- <field type="int" size="2" name="cpnBteLvc_W6" longname="unused9"/>
-
- <field type="int" size="2" name="lidFE" longname="fareastid"/>
- <field type="int" size="2" name="clw" longname="countints"/>
-
- <field type="int" size="4" name="cbMac" longname="last byte or beg ints"/>
-
- <field type="int" size="4" name="lProductCreated" longname="creator build date"/>
- <field type="int" size="4" name="lProductRevised" longname="revisor build date"/>
-
- <field type="int" size="4" name="ccpText" longname="main streamlen"/>
- <field type="int" size="4" name="ccpFtn" longname="footnote streamlen"/>
- <field type="int" size="4" name="ccpHdd" longname="header streamlen"/>
- <field type="int" size="4" name="ccpMcr" longname="macro streamlen"/>
- <field type="int" size="4" name="ccpAtn" longname="annotation streamlen"/>
- <field type="int" size="4" name="ccpEdn" longname="endnote streamlen"/>
- <field type="int" size="4" name="ccpTxbx" longname="textbox streamlen"/>
- <field type="int" size="4" name="ccpHdrTxbx" longname="headbox streamlen"/>
-
- <field type="int" size="4" name="pnFbpChpFirst" longname="ptr to plc list chp" description="rename me!"/>
- <field type="int" size="4" name="pnChpFirst" longname="first chp"/>
- <field type="int" size="4" name="cpnBteChp" longname="count chps"/>
-
- <field type="int" size="4" name="pnFbpPapFirst" longname="ptr to plc list pap" description="rename me!"/>
- <field type="int" size="4" name="pnPapFirst" longname="first pap"/>
- <field type="int" size="4" name="cpnBtePap" longname="count paps"/>
-
- <field type="int" size="4" name="pnFbpLvcFirst" longname="ptr to plc list lvc" description="rename me!"/>
- <field type="int" size="4" name="pnLvcFirst" longname="first lvc"/>
- <field type="int" size="4" name="cpnBteLvc" longname="count lvc"/>
-
- <field type="int" size="4" name="fcIslandFirst" longname="unknown1"/>
- <field type="int" size="4" name="fcIslandLim" longname="unknown2"/>
-
- <field type="int" size="2" name="cfclcb" longname="lcb array size"/>
- <field type="int" size="4" name="fcStshfOrig" longname="original stylesheet offset"/>
- <field type="int" size="4" name="lcbStshfOrig" longname="original stylesheet size"/>
- <field type="int" size="4" name="fcStshf" longname="stylesheet offset"/>
- <field type="int" size="4" name="lcbStshf" longname="stylesheet size"/>
- <field type="int" size="4" name="fcPlcffndRef" longname="footnote ref offset"/>
- <field type="int" size="4" name="lcbPlcffndRef" longname="footnote ref size"/>
-
- <field type="int" size="4" name="fcPlcffndTxt" longname="plc offset"/>
- <field type="int" size="4" name="lcbPlcffndTxt" longname="plc size"/>
-
- <field type="int" size="4" name="fcPlcfandRef" longname="annotation ref offset"/>
- <field type="int" size="4" name="lcbPlcfandRef" longname="annotation ref size"/>
-
- <field type="int" size="4" name="fcPlcfandTxt" longname="annotation plc offset"/>
- <field type="int" size="4" name="lcbPlcfandTxt" longname="annotation plc size"/>
-
- <field type="int" size="4" name="fcPlcfsed" longname="section plc offset"/>
- <field type="int" size="4" name="lcbPlcfsed" longname="section plc size"/>
-
- <field type="int" size="4" name="fcPlcpad" longname="unusedA"/>
- <field type="int" size="4" name="lcbPlcpad" longname="unusedB"/>
-
- <field type="int" size="4" name="fcPlcfphe" longname="pheplc offset"/>
- <field type="int" size="4" name="lcbPlcfphe" longname="pheplc size"/>
-
- <field type="int" size="4" name="fcSttbfglsy" longname="glossaryST offset"/>
- <field type="int" size="4" name="lcbSttbfglsy" longname="glossaryST size"/>
-
- <field type="int" size="4" name="fcPlcfglsy" longname="glossaryPLC offset"/>
- <field type="int" size="4" name="lcbPlcfglsy" longname="glossaryPLC size"/>
-
- <field type="int" size="4" name="fcPlcfhdd" longname="headerPLC offset"/>
- <field type="int" size="4" name="lcbPlcfhdd" longname="headerPLC size"/>
-
- <field type="int" size="4" name="fcPlcfbteChpx" longname="chp_bin_table_offset"/>
- <field type="int" size="4" name="lcbPlcfbteChpx" longname="chp_bin_table_size"/>
-
- <field type="int" size="4" name="fcPlcfbtePapx" longname="pap_bin_table_offset"/>
- <field type="int" size="4" name="lcbPlcfbtePapx" longname="pap_bin_table_size"/>
-
- <field type="int" size="4" name="fcPlcfsea" longname="sea_bin_table_offset"/>
- <field type="int" size="4" name="lcbPlcfsea" longname="sea_bin_table_size"/>
-
- <field type="int" size="4" name="fcSttbfffn" longname="fonts_bin_table_offset"/>
- <field type="int" size="4" name="lcbSttbfffn" longname="fonts_bin_table_size"/>
-
- <field type="int" size="4" name="fcPlcffldMom" longname="main_fields_offset"/>
- <field type="int" size="4" name="lcbPlcffldMom" longname="main_fields_size"/>
-
- <field type="int" size="4" name="fcPlcffldHdr" longname="header_fields_offset"/>
- <field type="int" size="4" name="lcbPlcffldHdr" longname="header_fields_size"/>
-
- <field type="int" size="4" name="fcPlcffldFtn" longname="footnote_fields_offset"/>
- <field type="int" size="4" name="lcbPlcffldFtn" longname="footnote_fields_size"/>
-
- <field type="int" size="4" name="fcPlcffldAtn" longname="ann_fields_offset"/>
- <field type="int" size="4" name="lcbPlcffldAtn" longname="ann_fields_size"/>
-
- <field type="int" size="4" name="fcPlcffldMcr" longname="unusedC"/>
- <field type="int" size="4" name="lcbPlcffldMcr" longname="unusedD"/>
-
- <field type="int" size="4" name="fcSttbfbkmk" longname="bookmark_names_offset"/>
- <field type="int" size="4" name="lcbSttbfbkmk" longname="bookmark_names_size"/>
- <field type="int" size="4" name="fcPlcfbkf" longname="bookmark_offsets_offset"/>
- <field type="int" size="4" name="lcbPlcfbkf" longname="bookmark_offsets_size"/>
- <field type="int" size="4" name="fcPlcfbkl" longname="bookmark_end_offset"/>
- <field type="int" size="4" name="lcbPlcfbkl" longname="bookmark_end_size"/>
-
- <field type="int" size="4" name="fcCmds" longname="macros_offset"/>
- <field type="int" size="4" name="lcbCmds" longname="macros_size"/>
-
- <field type="int" size="4" name="fcPlcmcr" longname="unusedE"/>
- <field type="int" size="4" name="lcbPlcmcr" longname="unusedF"/>
- <field type="int" size="4" name="fcSttbfmcr" longname="unused10"/>
- <field type="int" size="4" name="lcbSttbfmcr" longname="unused11"/>
-
- <field type="int" size="4" name="fcPrDrvr" longname="printer offset"/>
- <field type="int" size="4" name="lcbPrDrvr" longname="printer size"/>
- <field type="int" size="4" name="fcPrEnvPort" longname="printer portrait offset"/>
- <field type="int" size="4" name="lcbPrEnvPort" longname="printer portrait size"/>
- <field type="int" size="4" name="fcPrEnvLand" longname="printer landscape offset"/>
- <field type="int" size="4" name="lcbPrEnvLand" longname="printer landscape size"/>
-
- <field type="int" size="4" name="fcWss" longname="wss offset"/>
- <field type="int" size="4" name="lcbWss" longname="wss size"/>
-
- <field type="int" size="4" name="fcDop" longname="DOP offset"/>
- <field type="int" size="4" name="lcbDop" longname="DOP size"/>
-
- <field type="int" size="4" name="fcSttbfAssoc" longname="sttbfassoc_offset"/>
- <field type="int" size="4" name="lcbSttbfAssoc" longname="sttbfassoc_size"/>
-
- <field type="int" size="4" name="fcClx" longname="textPieceTable offset"/>
- <field type="int" size="4" name="lcbClx" longname="textPieceTable size"/>
-
- <field type="int" size="4" name="fcPlcfpgdFtn" longname="unused12"/>
- <field type="int" size="4" name="lcbPlcfpgdFtn" longname="unused13"/>
-
- <field type="int" size="4" name="fcAutosaveSource" longname="offset AutosaveSource"/>
- <field type="int" size="4" name="lcbAutosaveSource" longname="count AutosaveSource"/>
-
- <field type="int" size="4" name="fcGrpXstAtnOwners" longname="offset GrpXstAtnOwners"/>
- <field type="int" size="4" name="lcbGrpXstAtnOwners" longname="count GrpXstAtnOwners"/>
-
- <field type="int" size="4" name="fcSttbfAtnbkmk" longname="offset SttbfAtnbkmk"/>
- <field type="int" size="4" name="lcbSttbfAtnbkmk" longname="length SttbfAtnbkmk"/>
-
- <field type="int" size="4" name="fcPlcdoaMom" longname="unused14"/>
- <field type="int" size="4" name="lcbPlcdoaMom" longname="unused15"/>
- <field type="int" size="4" name="fcPlcdoaHdr" longname="unused16"/>
- <field type="int" size="4" name="lcbPlcdoaHdr" longname="unused17"/>
-
- <field type="int" size="4" name="fcPlcspaMom" longname="offset PlcspaMom"/>
- <field type="int" size="4" name="lcbPlcspaMom" longname="length PlcspaMom"/>
-
- <field type="int" size="4" name="fcPlcspaHdr" longname="offset PlcspaHdr"/>
- <field type="int" size="4" name="lcbPlcspaHdr" longname="length PlcspaHdr"/>
-
- <field type="int" size="4" name="fcPlcfAtnbkf" longname="length Plcf Ann Bkmrk First"/>
- <field type="int" size="4" name="lcbPlcfAtnbkf" longname="offset Plcf Ann Bkmrk First"/>
-
- <field type="int" size="4" name="fcPlcfAtnbkl" longname="length Plcf Ann Bkark Last"/>
-
- <field type="int" size="4" name="lcbPlcfAtnbkl"/>
-
- <field type="int" size="4" name="fcPms"/>
-
- <field type="int" size="4" name="lcbPms"/>
- <field type="int" size="4" name="fcFormFldSttbs"/>
-
- <field type="int" size="4" name="lcbFormFldSttbs"/>
- <field type="int" size="4" name="fcPlcfendRef"/>
- <field type="int" size="4" name="lcbPlcfendRef"/>
- <field type="int" size="4" name="fcPlcfendTxt"/>
-
- <field type="int" size="4" name="lcbPlcfendTxt"/>
- <field type="int" size="4" name="fcPlcffldEdn"/>
- <field type="int" size="4" name="lcbPlcffldEdn"/>
-
- <field type="int" size="4" name="fcPlcfpgdEdn"/>
- <field type="int" size="4" name="lcbPlcfpgdEdn"/>
- <field type="int" size="4" name="fcDggInfo"/>
- <field type="int" size="4" name="lcbDggInfo"/>
- <field type="int" size="4" name="fcSttbfRMark"/>
-
- <field type="int" size="4" name="lcbSttbfRMark"/>
- <field type="int" size="4" name="fcSttbCaption"/>
- <field type="int" size="4" name="lcbSttbCaption"/>
- <field type="int" size="4" name="fcSttbAutoCaption"/>
- <field type="int" size="4" name="lcbSttbAutoCaption"/>
- <field type="int" size="4" name="fcPlcfwkb"/>
- <field type="int" size="4" name="lcbPlcfwkb"/> -->
- <!--
- possible typo - was
- <field type="int" size="4" name="fcPlcfsplfcPlcfspl"/>
-
- documented as fcPlcfspl in MS Word Binary Format doc
- -->
- <!--<field type="int" size="4" name="fcPlcfspl"/>
- <field type="int" size="4" name="lcbPlcfspl"/>
-
- <field type="int" size="4" name="fcPlcftxbxTxt"/>
- <field type="int" size="4" name="lcbPlcftxbxTxt"/>
- <field type="int" size="4" name="fcPlcffldTxbx"/>
- <field type="int" size="4" name="lcbPlcffldTxbx"/>
- <field type="int" size="4" name="fcPlcfhdrtxbxTxt"/>
- <field type="int" size="4" name="lcbPlcfhdrtxbxTxt"/>
- <field type="int" size="4" name="fcPlcffldHdrTxbx"/>
- <field type="int" size="4" name="lcbPlcffldHdrTxbx"/>
- <field type="int" size="4" name="fcStwUser"/>
- <field type="int" size="4" name="lcbStwUser"/>
-
- <field type="int" size="4" name="fcSttbttmbd"/>
- <field type="int" size="4" name="cbSttbttmbd"/>
- <field type="int" size="4" name="fcUnused"/>
- <field type="int" size="4" name="lcbUnused"/> -->
- <!--
- Bug - this field is meant to be an array that "overlays"
- the following fields. See MS Word Binary Format doc
- for details.
- <field type="int" size="4" name="rgpgdbkd"/>
- -->
- <!--<field type="int" size="4" name="fcPgdMother"/>
- <field type="int" size="4" name="lcbPgdMother"/>
- <field type="int" size="4" name="fcBkdMother"/>
- <field type="int" size="4" name="lcbBkdMother"/>
- <field type="int" size="4" name="fcPgdFtn"/>
-
- <field type="int" size="4" name="lcbPgdFtn"/>
- <field type="int" size="4" name="fcBkdFtn"/>
- <field type="int" size="4" name="lcbBkdFtn"/>
- <field type="int" size="4" name="fcPgdEdn"/>
- <field type="int" size="4" name="lcbPgdEdn"/>
- <field type="int" size="4" name="fcBkdEdn"/>
- <field type="int" size="4" name="lcbBkdEdn"/>
- <field type="int" size="4" name="fcSttbfIntlFld"/>
- <field type="int" size="4" name="lcbSttbfIntlFld"/>
- <field type="int" size="4" name="fcRouteSlip"/>
- <field type="int" size="4" name="lcbRouteSlip"/>
-
- <field type="int" size="4" name="fcSttbSavedBy"/>
- <field type="int" size="4" name="lcbSttbSavedBy"/>
- <field type="int" size="4" name="fcSttbFnm"/>
- <field type="int" size="4" name="lcbSttbFnm"/>
- <field type="int" size="4" name="fcPlcfLst"/>
- <field type="int" size="4" name="lcbPlcfLst"/>
- <field type="int" size="4" name="fcPlfLfo"/>
- <field type="int" size="4" name="lcbPlfLfo"/>
- <field type="int" size="4" name="fcPlcftxbxBkd"/>
- <field type="int" size="4" name="lcbPlcftxbxBkd"/>
-
- <field type="int" size="4" name="fcPlcftxbxHdrBkd"/>
- <field type="int" size="4" name="lcbPlcftxbxHdrBkd"/>
- <field type="int" size="4" name="fcDocUndo"/>
- <field type="int" size="4" name="lcbDocUndo"/>
- <field type="int" size="4" name="fcRgbuse"/>
- <field type="int" size="4" name="lcbRgbuse"/>
- <field type="int" size="4" name="fcUsp"/>
- <field type="int" size="4" name="lcbUsp"/>
- <field type="int" size="4" name="fcUskf"/>
- <field type="int" size="4" name="lcbUskf"/>
- <field type="int" size="4" name="fcPlcupcRgbuse"/>
- <field type="int" size="4" name="lcbPlcupcRgbuse"/>
- <field type="int" size="4" name="fcPlcupcUsp"/>
-
- <field type="int" size="4" name="lcbPlcupcUsp"/>
- <field type="int" size="4" name="fcSttbGlsyStyle"/>
- <field type="int" size="4" name="lcbSttbGlsyStyle"/>
- <field type="int" size="4" name="fcPlgosl"/>
- <field type="int" size="4" name="lcbPlgosl"/>
- <field type="int" size="4" name="fcPlcocx"/>
- <field type="int" size="4" name="lcbPlcocx"/>
- <field type="int" size="4" name="fcPlcfbteLvc"/>
- <field type="int" size="4" name="lcbPlcfbteLvc"/> -->
- <!--
- Bug - this field is meant to "overlay" the following
- two fields. See MS Word Binary Format doc
- for details.
- <field type="int" size="4" name="ftModified"/>
- -->
- <!--<field type="int" size="4" name="dwLowDateTime"/>
- <field type="int" size="4" name="dwHighDateTime"/>
- <field type="int" size="4" name="fcPlcflvc"/>
- <field type="int" size="4" name="lcbPlcflvc"/>
- <field type="int" size="4" name="fcPlcasumy"/>
- <field type="int" size="4" name="lcbPlcasumy"/>
- <field type="int" size="4" name="fcPlcfgram"/>
-
- <field type="int" size="4" name="lcbPlcfgram"/>
- <field type="int" size="4" name="fcSttbListNames"/>
- <field type="int" size="4" name="lcbSttbListNames"/>
- <field type="int" size="4" name="fcSttbfUssr"/>
- <field type="int" size="4" name="lcbSttbfUssr"/> -->
-
-
- </fields>
-
-</record>
</xsl:text>
<xsl:for-each select="//fields/field">
+ <xsl:if test="@deprecated='true'">
+ <xsl:call-template name="indent"/>
+ <xsl:text>@Deprecated</xsl:text>
+ <xsl:call-template name="linebreak"/>
+ </xsl:if>
<xsl:call-template name="indent"/>
<xsl:text>protected </xsl:text>
<xsl:value-of select="@type"/>
/**
* <xsl:value-of select="@description"/>
- * @return the <xsl:value-of select="@name"/> field value.
- */
- @Internal
- public <xsl:value-of select="recutil:getBitFieldFunction(@name,@mask,../@type, 'true')"/>()
+ * @return the <xsl:value-of select="@name"/><xsl:text> field value.</xsl:text>
+ <xsl:call-template name="linebreak"/>
+ <xsl:if test="@deprecated='true'">
+ <xsl:call-template name="indent"/>
+ <xsl:text> * @deprecated This field should not be used according to specification</xsl:text>
+ <xsl:call-template name="linebreak"/>
+ </xsl:if>
+ <xsl:call-template name="indent"/>
+ <xsl:text> */</xsl:text>
+ <xsl:call-template name="linebreak"/>
+ <xsl:call-template name="indent"/>
+ <xsl:text>@Internal</xsl:text>
+ <xsl:call-template name="linebreak"/>
+ <xsl:if test="@deprecated='true'">
+ <xsl:call-template name="indent"/>
+ <xsl:text>@Deprecated</xsl:text>
+ <xsl:call-template name="linebreak"/>
+ </xsl:if>
+ <xsl:call-template name="indent"/>
+ <xsl:text>public </xsl:text><xsl:value-of select="recutil:getBitFieldFunction(@name,@mask,../@type, 'true')"/><xsl:text>()</xsl:text>
{
return <xsl:value-of select="recutil:getBitFieldGet(@name, @mask,../@type, recutil:getFieldName($fieldNum,../@name,0))"/>
}