extract FibBase from FIB

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1178019 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-10-01 15:32:32 +00:00
parent c96302efc7
commit a4ec172b7a
15 changed files with 1111 additions and 1186 deletions

View File

@ -226,13 +226,13 @@ public final class HWPFDocument extends HWPFDocumentCore
_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;
}
@ -904,8 +904,8 @@ public final class HWPFDocument extends HWPFDocumentCore
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.
@ -918,7 +918,7 @@ public final class HWPFDocument extends HWPFDocumentCore
}
// Table1 stream will be used
_fib.setFWhichTblStm( true );
_fib.getFibBase().setFWhichTblStm( true );
// write out the FileInformationBlock.
//_fib.serialize(mainBuf, 0);

View File

@ -154,7 +154,7 @@ public abstract class HWPFDocumentCore extends POIDocument
// 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!");
}

View File

@ -67,10 +67,10 @@ public class HWPFOldDocument extends HWPFDocumentCore {
// 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();
@ -83,13 +83,13 @@ public class HWPFOldDocument extends HWPFDocumentCore {
// 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
);
@ -103,22 +103,22 @@ public class HWPFOldDocument extends HWPFDocumentCore {
// 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()

View File

@ -0,0 +1,111 @@
/* ====================================================================
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;
}
}

View File

@ -23,7 +23,6 @@ import java.lang.reflect.Modifier;
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;
/**
@ -43,10 +42,11 @@ 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;
@ -54,7 +54,7 @@ public final class FileInformationBlock extends FIBAbstractType
/** 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 )
@ -110,7 +110,8 @@ public final class FileInformationBlock extends FIBAbstractType
@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() )
@ -954,38 +955,32 @@ public final class FileInformationBlock extends FIBAbstractType
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");
super.serialize(mainStream, 0);
_fibBase.serialize( mainStream, 0 );
int offset = FibBase.getSize();
int size = super.getSize();
_shortHandler.serialize(mainStream);
_longHandler.serialize(mainStream, size + _shortHandler.sizeInBytes());
_fieldHandler.writeTo(mainStream,
super.getSize() + _shortHandler.sizeInBytes() + _longHandler.sizeInBytes(), tableStream);
_shortHandler.serialize( mainStream );
offset += _shortHandler.sizeInBytes();
_longHandler.serialize( mainStream, offset );
offset += _longHandler.sizeInBytes();
_fieldHandler.writeTo( mainStream, offset, tableStream );
}
public int getSize()
{
return super.getSize() + _shortHandler.sizeInBytes() +
_longHandler.sizeInBytes() + _fieldHandler.sizeInBytes();
return FibBase.getSize() + _shortHandler.sizeInBytes()
+ _longHandler.sizeInBytes() + _fieldHandler.sizeInBytes();
}
// public Object clone()
// {
// try
// {
// return super.clone();
// }
// catch (CloneNotSupportedException e)
// {
// e.printStackTrace();
// return null;
// }
// }
public FibBase getFibBase()
{
return _fibBase;
}
}

View File

@ -1,759 +0,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.
==================================================================== */
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);
}
}

View File

@ -0,0 +1,837 @@
/* ====================================================================
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.util.BitField;
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. <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
* <p>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* remove the record in src/types/definitions.
* <p>
* This class is internal. It content or properties may change without notice
* due to changes in our knowledge of internal Microsoft Word binary structures.
* @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 abstract class FibBaseAbstractType
{
protected int field_1_wIdent;
protected int field_2_nFib;
protected int field_3_unused;
protected int field_4_lid;
protected int field_5_pnNext;
protected short field_6_flags1;
/**/private static final BitField fDot = new BitField(0x0001);
/**/private static final BitField fGlsy = new BitField(0x0002);
/**/private static final BitField fComplex = new BitField(0x0004);
/**/private static final BitField fHasPic = new BitField(0x0008);
/**/private static final BitField cQuickSaves = new BitField(0x00F0);
/**/private static final BitField fEncrypted = new BitField(0x0100);
/**/private static final BitField fWhichTblStm = new BitField(0x0200);
/**/private static final BitField fReadOnlyRecommended = new BitField(0x0400);
/**/private static final BitField fWriteReservation = new BitField(0x0800);
/**/private static final BitField fExtChar = new BitField(0x1000);
/**/private static final BitField fLoadOverride = new BitField(0x2000);
/**/private static final BitField fFarEast = new BitField(0x4000);
/**/private static final BitField fObfuscated = new BitField(0x8000);
protected int field_7_nFibBack;
protected int field_8_lKey;
@Deprecated
protected byte field_9_envr;
protected byte field_10_flags2;
/**/private static final BitField fMac = new BitField(0x01);
/**/private static final BitField fEmptySpecial = new BitField(0x02);
/**/private static final BitField fLoadOverridePage = new BitField(0x04);
/**/private static final BitField reserved1 = new BitField(0x08);
/**/private static final BitField reserved2 = new BitField(0x10);
/**/private static final BitField fSpare0 = new BitField(0xFE);
@Deprecated
protected short field_11_Chs;
@Deprecated
protected short field_12_chsTables;
@Deprecated
protected int field_13_fcMin;
@Deprecated
protected int field_14_fcMac;
protected FibBaseAbstractType()
{
}
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_unused = LittleEndian.getShort( data, 0x4 + offset );
field_4_lid = LittleEndian.getShort( data, 0x6 + offset );
field_5_pnNext = LittleEndian.getShort( data, 0x8 + offset );
field_6_flags1 = LittleEndian.getShort( data, 0xa + offset );
field_7_nFibBack = LittleEndian.getShort( data, 0xc + offset );
field_8_lKey = LittleEndian.getInt( data, 0xe + offset );
field_9_envr = data[ 0x12 + offset ];
field_10_flags2 = data[ 0x13 + 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.putUShort( data, 0x0 + offset, field_1_wIdent );
LittleEndian.putUShort( data, 0x2 + offset, field_2_nFib );
LittleEndian.putUShort( data, 0x4 + offset, field_3_unused );
LittleEndian.putUShort( data, 0x6 + offset, field_4_lid );
LittleEndian.putUShort( data, 0x8 + offset, field_5_pnNext );
LittleEndian.putShort( data, 0xa + offset, field_6_flags1 );
LittleEndian.putUShort( data, 0xc + offset, field_7_nFibBack );
LittleEndian.putInt( data, 0xe + offset, field_8_lKey );
data[ 0x12 + offset ] = field_9_envr;
data[ 0x13 + offset ] = field_10_flags2;
LittleEndian.putShort( data, 0x14 + offset, field_11_Chs );
LittleEndian.putShort( data, 0x16 + offset, field_12_chsTables );
LittleEndian.putInt( data, 0x18 + offset, field_13_fcMin );
LittleEndian.putInt( data, 0x1c + offset, field_14_fcMac );
}
public byte[] serialize()
{
final byte[] result = new byte[ getSize() ];
serialize( result, 0 );
return result;
}
/**
* Size of record
*/
public static int getSize()
{
return 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4 + 1 + 1 + 2 + 2 + 4 + 4;
}
public String toString()
{
StringBuilder builder = new StringBuilder();
builder.append("[FibBase]\n");
builder.append(" .wIdent = ");
builder.append(" (").append(getWIdent()).append(" )\n");
builder.append(" .nFib = ");
builder.append(" (").append(getNFib()).append(" )\n");
builder.append(" .unused = ");
builder.append(" (").append(getUnused()).append(" )\n");
builder.append(" .lid = ");
builder.append(" (").append(getLid()).append(" )\n");
builder.append(" .pnNext = ");
builder.append(" (").append(getPnNext()).append(" )\n");
builder.append(" .flags1 = ");
builder.append(" (").append(getFlags1()).append(" )\n");
builder.append(" .fDot = ").append(isFDot()).append('\n');
builder.append(" .fGlsy = ").append(isFGlsy()).append('\n');
builder.append(" .fComplex = ").append(isFComplex()).append('\n');
builder.append(" .fHasPic = ").append(isFHasPic()).append('\n');
builder.append(" .cQuickSaves = ").append(getCQuickSaves()).append('\n');
builder.append(" .fEncrypted = ").append(isFEncrypted()).append('\n');
builder.append(" .fWhichTblStm = ").append(isFWhichTblStm()).append('\n');
builder.append(" .fReadOnlyRecommended = ").append(isFReadOnlyRecommended()).append('\n');
builder.append(" .fWriteReservation = ").append(isFWriteReservation()).append('\n');
builder.append(" .fExtChar = ").append(isFExtChar()).append('\n');
builder.append(" .fLoadOverride = ").append(isFLoadOverride()).append('\n');
builder.append(" .fFarEast = ").append(isFFarEast()).append('\n');
builder.append(" .fObfuscated = ").append(isFObfuscated()).append('\n');
builder.append(" .nFibBack = ");
builder.append(" (").append(getNFibBack()).append(" )\n");
builder.append(" .lKey = ");
builder.append(" (").append(getLKey()).append(" )\n");
builder.append(" .envr = ");
builder.append(" (").append(getEnvr()).append(" )\n");
builder.append(" .flags2 = ");
builder.append(" (").append(getFlags2()).append(" )\n");
builder.append(" .fMac = ").append(isFMac()).append('\n');
builder.append(" .fEmptySpecial = ").append(isFEmptySpecial()).append('\n');
builder.append(" .fLoadOverridePage = ").append(isFLoadOverridePage()).append('\n');
builder.append(" .reserved1 = ").append(isReserved1()).append('\n');
builder.append(" .reserved2 = ").append(isReserved2()).append('\n');
builder.append(" .fSpare0 = ").append(getFSpare0()).append('\n');
builder.append(" .Chs = ");
builder.append(" (").append(getChs()).append(" )\n");
builder.append(" .chsTables = ");
builder.append(" (").append(getChsTables()).append(" )\n");
builder.append(" .fcMin = ");
builder.append(" (").append(getFcMin()).append(" )\n");
builder.append(" .fcMac = ");
builder.append(" (").append(getFcMac()).append(" )\n");
builder.append("[/FibBase]\n");
return builder.toString();
}
/**
* An unsigned integer that specifies that this is a Word Binary File. This value MUST be 0xA5EC.
*/
@Internal
public int getWIdent()
{
return field_1_wIdent;
}
/**
* An unsigned integer that specifies that this is a Word Binary File. This value MUST be 0xA5EC.
*/
@Internal
public void setWIdent( int field_1_wIdent )
{
this.field_1_wIdent = field_1_wIdent;
}
/**
* 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.
*/
@Internal
public int getNFib()
{
return field_2_nFib;
}
/**
* 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.
*/
@Internal
public void setNFib( int field_2_nFib )
{
this.field_2_nFib = field_2_nFib;
}
/**
* This value is undefined and MUST be ignored.
*/
@Internal
public int getUnused()
{
return field_3_unused;
}
/**
* This value is undefined and MUST be ignored.
*/
@Internal
public void setUnused( int field_3_unused )
{
this.field_3_unused = field_3_unused;
}
/**
* 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..
*/
@Internal
public int getLid()
{
return field_4_lid;
}
/**
* 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..
*/
@Internal
public void setLid( int field_4_lid )
{
this.field_4_lid = field_4_lid;
}
/**
* An unsigned integer that specifies the offset in the WordDocument stream of the FIB for the document which contains all the AutoText items.
*/
@Internal
public int getPnNext()
{
return field_5_pnNext;
}
/**
* An unsigned integer that specifies the offset in the WordDocument stream of the FIB for the document which contains all the AutoText items.
*/
@Internal
public void setPnNext( int field_5_pnNext )
{
this.field_5_pnNext = field_5_pnNext;
}
/**
* Get the flags1 field for the FibBase record.
*/
@Internal
public short getFlags1()
{
return field_6_flags1;
}
/**
* Set the flags1 field for the FibBase record.
*/
@Internal
public void setFlags1( short field_6_flags1 )
{
this.field_6_flags1 = field_6_flags1;
}
/**
* This value SHOULD be 0x00BF. This value MUST be 0x00BF or 0x00C1.
*/
@Internal
public int getNFibBack()
{
return field_7_nFibBack;
}
/**
* This value SHOULD be 0x00BF. This value MUST be 0x00BF or 0x00C1.
*/
@Internal
public void setNFibBack( int field_7_nFibBack )
{
this.field_7_nFibBack = field_7_nFibBack;
}
/**
* 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.
*/
@Internal
public int getLKey()
{
return field_8_lKey;
}
/**
* 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.
*/
@Internal
public void setLKey( int field_8_lKey )
{
this.field_8_lKey = field_8_lKey;
}
/**
* This value MUST be 0, and MUST be ignored.
*/
@Internal
public byte getEnvr()
{
return field_9_envr;
}
/**
* This value MUST be 0, and MUST be ignored.
*/
@Internal
public void setEnvr( byte field_9_envr )
{
this.field_9_envr = field_9_envr;
}
/**
* Get the flags2 field for the FibBase record.
*/
@Internal
public byte getFlags2()
{
return field_10_flags2;
}
/**
* Set the flags2 field for the FibBase record.
*/
@Internal
public void setFlags2( byte field_10_flags2 )
{
this.field_10_flags2 = field_10_flags2;
}
/**
* This value MUST be 0 and MUST be ignored.
*/
@Internal
public short getChs()
{
return field_11_Chs;
}
/**
* This value MUST be 0 and MUST be ignored.
*/
@Internal
public void setChs( short field_11_Chs )
{
this.field_11_Chs = field_11_Chs;
}
/**
* This value MUST be 0 and MUST be ignored.
*/
@Internal
public short getChsTables()
{
return field_12_chsTables;
}
/**
* This value MUST be 0 and MUST be ignored.
*/
@Internal
public void setChsTables( short field_12_chsTables )
{
this.field_12_chsTables = field_12_chsTables;
}
/**
* This value is undefined and MUST be ignored.
*/
@Internal
public int getFcMin()
{
return field_13_fcMin;
}
/**
* This value is undefined and MUST be ignored.
*/
@Internal
public void setFcMin( int field_13_fcMin )
{
this.field_13_fcMin = field_13_fcMin;
}
/**
* This value is undefined and MUST be ignored.
*/
@Internal
public int getFcMac()
{
return field_14_fcMac;
}
/**
* This value is undefined and MUST be ignored.
*/
@Internal
public void setFcMac( int field_14_fcMac )
{
this.field_14_fcMac = field_14_fcMac;
}
/**
* Sets the fDot field value.
* Specifies whether this is a document template
*/
@Internal
public void setFDot( boolean value )
{
field_6_flags1 = (short)fDot.setBoolean(field_6_flags1, value);
}
/**
* Specifies whether this is a document template
* @return the fDot field value.
*/
@Internal
public boolean isFDot()
{
return fDot.isSet(field_6_flags1);
}
/**
* Sets the fGlsy field value.
* Specifies whether this is a document that contains only AutoText items
*/
@Internal
public void setFGlsy( boolean value )
{
field_6_flags1 = (short)fGlsy.setBoolean(field_6_flags1, value);
}
/**
* Specifies whether this is a document that contains only AutoText items
* @return the fGlsy field value.
*/
@Internal
public boolean isFGlsy()
{
return fGlsy.isSet(field_6_flags1);
}
/**
* Sets the fComplex field value.
* Specifies that the last save operation that was performed on this document was an incremental save operation
*/
@Internal
public void setFComplex( boolean value )
{
field_6_flags1 = (short)fComplex.setBoolean(field_6_flags1, value);
}
/**
* Specifies that the last save operation that was performed on this document was an incremental save operation
* @return the fComplex field value.
*/
@Internal
public boolean isFComplex()
{
return fComplex.isSet(field_6_flags1);
}
/**
* Sets the fHasPic field value.
* When set to 0, there SHOULD be no pictures in the document
*/
@Internal
public void setFHasPic( boolean value )
{
field_6_flags1 = (short)fHasPic.setBoolean(field_6_flags1, value);
}
/**
* When set to 0, there SHOULD be no pictures in the document
* @return the fHasPic field value.
*/
@Internal
public boolean isFHasPic()
{
return fHasPic.isSet(field_6_flags1);
}
/**
* Sets the cQuickSaves field value.
* 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
*/
@Internal
public void setCQuickSaves( byte value )
{
field_6_flags1 = (short)cQuickSaves.setValue(field_6_flags1, value);
}
/**
* 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
* @return the cQuickSaves field value.
*/
@Internal
public byte getCQuickSaves()
{
return ( byte )cQuickSaves.getValue(field_6_flags1);
}
/**
* Sets the fEncrypted field value.
* Specifies whether the document is encrypted or obfuscated as specified in Encryption and Obfuscation
*/
@Internal
public void setFEncrypted( boolean value )
{
field_6_flags1 = (short)fEncrypted.setBoolean(field_6_flags1, value);
}
/**
* Specifies whether the document is encrypted or obfuscated as specified in Encryption and Obfuscation
* @return the fEncrypted field value.
*/
@Internal
public boolean isFEncrypted()
{
return fEncrypted.isSet(field_6_flags1);
}
/**
* Sets the fWhichTblStm field value.
* 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.
*/
@Internal
public void setFWhichTblStm( boolean value )
{
field_6_flags1 = (short)fWhichTblStm.setBoolean(field_6_flags1, value);
}
/**
* 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.
* @return the fWhichTblStm field value.
*/
@Internal
public boolean isFWhichTblStm()
{
return fWhichTblStm.isSet(field_6_flags1);
}
/**
* Sets the fReadOnlyRecommended field value.
* Specifies whether the document author recommended that the document be opened in read-only mode
*/
@Internal
public void setFReadOnlyRecommended( boolean value )
{
field_6_flags1 = (short)fReadOnlyRecommended.setBoolean(field_6_flags1, value);
}
/**
* Specifies whether the document author recommended that the document be opened in read-only mode
* @return the fReadOnlyRecommended field value.
*/
@Internal
public boolean isFReadOnlyRecommended()
{
return fReadOnlyRecommended.isSet(field_6_flags1);
}
/**
* Sets the fWriteReservation field value.
* Specifies whether the document has a write-reservation password
*/
@Internal
public void setFWriteReservation( boolean value )
{
field_6_flags1 = (short)fWriteReservation.setBoolean(field_6_flags1, value);
}
/**
* Specifies whether the document has a write-reservation password
* @return the fWriteReservation field value.
*/
@Internal
public boolean isFWriteReservation()
{
return fWriteReservation.isSet(field_6_flags1);
}
/**
* Sets the fExtChar field value.
* This value MUST be 1
*/
@Internal
public void setFExtChar( boolean value )
{
field_6_flags1 = (short)fExtChar.setBoolean(field_6_flags1, value);
}
/**
* This value MUST be 1
* @return the fExtChar field value.
*/
@Internal
public boolean isFExtChar()
{
return fExtChar.isSet(field_6_flags1);
}
/**
* Sets the fLoadOverride field value.
* 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
*/
@Internal
public void setFLoadOverride( boolean value )
{
field_6_flags1 = (short)fLoadOverride.setBoolean(field_6_flags1, value);
}
/**
* 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
* @return the fLoadOverride field value.
*/
@Internal
public boolean isFLoadOverride()
{
return fLoadOverride.isSet(field_6_flags1);
}
/**
* Sets the fFarEast field value.
* Specifies whether the installation language of the application that created the document was an East Asian language
*/
@Internal
public void setFFarEast( boolean value )
{
field_6_flags1 = (short)fFarEast.setBoolean(field_6_flags1, value);
}
/**
* Specifies whether the installation language of the application that created the document was an East Asian language
* @return the fFarEast field value.
*/
@Internal
public boolean isFFarEast()
{
return fFarEast.isSet(field_6_flags1);
}
/**
* Sets the fObfuscated field value.
* If fEncrypted is 1, this bit specifies whether the document is obfuscated by using XOR obfuscation; otherwise, this bit MUST be ignored
*/
@Internal
public void setFObfuscated( boolean value )
{
field_6_flags1 = (short)fObfuscated.setBoolean(field_6_flags1, value);
}
/**
* If fEncrypted is 1, this bit specifies whether the document is obfuscated by using XOR obfuscation; otherwise, this bit MUST be ignored
* @return the fObfuscated field value.
*/
@Internal
public boolean isFObfuscated()
{
return fObfuscated.isSet(field_6_flags1);
}
/**
* Sets the fMac field value.
* This value MUST be 0, and MUST be ignored
*/
@Internal
public void setFMac( boolean value )
{
field_10_flags2 = (byte)fMac.setBoolean(field_10_flags2, value);
}
/**
* This value MUST be 0, and MUST be ignored
* @return the fMac field value.
* @deprecated This field should not be used according to specification
*/
@Internal
@Deprecated
public boolean isFMac()
{
return fMac.isSet(field_10_flags2);
}
/**
* Sets the fEmptySpecial field value.
* This value SHOULD be 0 and SHOULD be ignored
*/
@Internal
public void setFEmptySpecial( boolean value )
{
field_10_flags2 = (byte)fEmptySpecial.setBoolean(field_10_flags2, value);
}
/**
* This value SHOULD be 0 and SHOULD be ignored
* @return the fEmptySpecial field value.
* @deprecated This field should not be used according to specification
*/
@Internal
@Deprecated
public boolean isFEmptySpecial()
{
return fEmptySpecial.isSet(field_10_flags2);
}
/**
* Sets the fLoadOverridePage field value.
* 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
*/
@Internal
public void setFLoadOverridePage( boolean value )
{
field_10_flags2 = (byte)fLoadOverridePage.setBoolean(field_10_flags2, value);
}
/**
* 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
* @return the fLoadOverridePage field value.
*/
@Internal
public boolean isFLoadOverridePage()
{
return fLoadOverridePage.isSet(field_10_flags2);
}
/**
* Sets the reserved1 field value.
* This value is undefined and MUST be ignored
*/
@Internal
public void setReserved1( boolean value )
{
field_10_flags2 = (byte)reserved1.setBoolean(field_10_flags2, value);
}
/**
* This value is undefined and MUST be ignored
* @return the reserved1 field value.
* @deprecated This field should not be used according to specification
*/
@Internal
@Deprecated
public boolean isReserved1()
{
return reserved1.isSet(field_10_flags2);
}
/**
* Sets the reserved2 field value.
* This value is undefined and MUST be ignored
*/
@Internal
public void setReserved2( boolean value )
{
field_10_flags2 = (byte)reserved2.setBoolean(field_10_flags2, value);
}
/**
* This value is undefined and MUST be ignored
* @return the reserved2 field value.
* @deprecated This field should not be used according to specification
*/
@Internal
@Deprecated
public boolean isReserved2()
{
return reserved2.isSet(field_10_flags2);
}
/**
* Sets the fSpare0 field value.
* This value is undefined and MUST be ignored
*/
@Internal
public void setFSpare0( byte value )
{
field_10_flags2 = (byte)fSpare0.setValue(field_10_flags2, value);
}
/**
* This value is undefined and MUST be ignored
* @return the fSpare0 field value.
* @deprecated This field should not be used according to specification
*/
@Internal
@Deprecated
public byte getFSpare0()
{
return ( byte )fSpare0.getValue(field_10_flags2);
}
} // END OF CLASS

View File

@ -53,7 +53,7 @@ public final class HWPFDocFixture
_fib = new FileInformationBlock(_mainStream);
String name = "0Table";
if (_fib.isFWhichTblStm())
if (_fib.getFibBase().isFWhichTblStm())
{
name = "1Table";
}

View File

@ -44,7 +44,7 @@ public final class TestCHPBinTable
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);

View File

@ -35,7 +35,7 @@ public final class TestFileInformationBlock
int size = _fileInformationBlock.getSize();
byte[] buf = new byte[size];
_fileInformationBlock.serialize(buf, 0);
_fileInformationBlock.getFibBase().serialize(buf, 0);
FileInformationBlock newFileInformationBlock =
new FileInformationBlock(buf);

View File

@ -36,7 +36,7 @@ public final class TestSectionTable
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);

View File

@ -38,7 +38,7 @@ public final class TestTextPieceTable extends TestCase {
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);

View File

@ -0,0 +1,94 @@
<?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. &lt;p&gt;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>

View File

@ -1,374 +0,0 @@
<?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>

View File

@ -50,6 +50,11 @@ public abstract class </xsl:text><xsl:value-of select="@name"/><xsl:text>Abstrac
</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"/>
@ -236,10 +241,26 @@ public abstract class </xsl:text><xsl:value-of select="@name"/><xsl:text>Abstrac
/**
* <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))"/>
}