private void initTableStream() throws IOException
{
String tablename = null;
- if(_fib.useTable1())
+ if(_fib.isTabletype())
{
tablename="1Table";
}
*/
private void initTextPieces() throws IOException
{
- int pos = _fib.getComplexOffset();
+ int pos = _fib.getTextPieceTableOffset();
//skips through the prms before we reach the piece table. These contain data
//for actual fast saved files
*/
private void initCharacterProperties()
{
- int charOffset = _fib.getChpBinTableOffset();
- int charPlcSize = _fib.getChpBinTableSize();
+ int charOffset = _fib.getChp_bin_table_offset();
+ int charPlcSize = _fib.getChp_bin_table_size();
int arraySize = (charPlcSize - 4)/8;
private void initParagraphProperties()
{
//find paragraphs
- int parOffset = _fib.getPapBinTableOffset();
- int parPlcSize = _fib.getPapBinTableSize();
+ int parOffset = _fib.getPap_bin_table_offset();
+ int parPlcSize = _fib.getPap_bin_table_size();
int arraySize = (parPlcSize - 4)/8;
//first we must go through the bin table and find the fkps
private void initSectionProperties()
{
//find sections
- int fcMin = _fib.getFirstCharOffset();
- int plcfsedFC = _fib.getSectionDescriptorOffset();
- int plcfsedSize = _fib.getSectionDescriptorSize();
+ int fcMin = _fib.getOffsetFirstChar();
+ int plcfsedFC = _fib.getSectionPlcOffset();
+ int plcfsedSize = _fib.getSectionPlcSize();
byte[] plcfsed = new byte[plcfsedSize];
System.arraycopy(_tableBuffer, plcfsedFC, plcfsed, 0, plcfsedSize);
*/
private void createStyleSheet()
{
- int stshIndex = _fib.getStshOffset();
- int stshSize = _fib.getStshSize();
+ int stshIndex = _fib.getStylesheetOffset();
+ int stshSize = _fib.getStylesheetSize();
byte[] stsh = new byte[stshSize];
System.arraycopy(_tableBuffer, stshIndex, stsh, 0, stshSize);
*/
private void createListTables()
{
- int lfoOffset = _fib.getLFOOffset();
- int lfoSize = _fib.getLFOSize();
+ int lfoOffset = _fib.getFcPlfLfo();
+ int lfoSize = _fib.getLcbPlfLfo();
byte[] plflfo = new byte[lfoSize];
System.arraycopy(_tableBuffer, lfoOffset, plflfo, 0, lfoSize);
- int lstOffset = _fib.getLSTOffset();
+ int lstOffset = _fib.getFcPlcfLst();
int lstSize = lstOffset;
//not sure if this is a mistake or what. I vaguely remember a trick like
//this
*/
private void createFontTable()
{
- int fontTableIndex = _fib.getFontsOffset();
- int fontTableSize = _fib.getFontsSize();
+ int fontTableIndex = _fib.getFonts_bin_table_offset();
+ int fontTableSize = _fib.getFonts_bin_table_size();
byte[] fontTable = new byte[fontTableSize];
System.arraycopy(_tableBuffer, fontTableIndex, fontTable, 0, fontTableSize);
_fonts = new FontTable(fontTable);
import org.apache.poi.util.LittleEndian;
-//import org.apache.poi.hdf.model.hdftypes.definitions;
+import org.apache.poi.hdf.model.hdftypes.definitions.FIBAbstractType;
/**
*
* @author andy
*/
-public class FileInformationBlock //extends FIBAbstractType
+public class FileInformationBlock extends FIBAbstractType
{
-
+/*
private short field_1_id;
private short field_2_version; // 101 = Word 6.0 +
private short field_3_product_version;
private int field_31_last_byte;
private int field_32_creator_build_date;
- private int field_33_revisor_build_date;
+ private int field_33_revisor_build_date; */
/** length of main document text stream*/
- private int field_34_main_streamlen;
+// private int field_34_main_streamlen;
/**length of footnote subdocument text stream*/
- private int field_35_footnote_streamlen;
+/* private int field_35_footnote_streamlen;
private int field_36_header_streamlen;
private int field_37_macro_streamlen;
private int field_38_annotation_streamlen;
private int field_39_endnote_streamlen;
private int field_40_textbox_streamlen;
- private int field_41_headbox_streamlen;
+ private int field_41_headbox_streamlen; */
/**offset in table stream of character property bin table*/
- private int field_42_pointer_to_plc_list_chp; //rename me!
- private int field_43_first_chp; //rename me
- private int field_44_count_chps; //rename me
+// private int field_42_pointer_to_plc_list_chp; //rename me!
+// private int field_43_first_chp; //rename me
+// private int field_44_count_chps; //rename me
/**offset in table stream of paragraph property bin */
- private int field_45_pointer_to_plc_list_pap; //rename me.
+ /* private int field_45_pointer_to_plc_list_pap; //rename me.
private int field_46_first_pap; //rename me
private int field_47_count_paps; //rename me
private int field_48_pointer_to_plc_list_lvc; //rename me
private int field_50_count_lvc; //rename me
private int field_51_unknown;
- private int field_52_unknown;
- //not sure about this array.
+ private int field_52_unknown; */
+ //not sure about this array.
+/*
private short field_53_fc_lcb_array_size;
private int field_54_original_stylesheet_offset;
private int field_55_original_stylesheet_size;
private int field_62_annotation_ref_offset;
private int field_63_annotation_ref_size;
private int field_64_annotation_plc_offset;
- private int field_65_annotation_plc_size;
+ private int field_65_annotation_plc_size; */
/** offset in table stream of section descriptor SED PLC*/
- private int field_66_section_plc_offset;
+/* private int field_66_section_plc_offset;
private int field_67_section_plc_size;
private int field_68_unused;
private int field_69_unused;
private int field_114_DOP_offset;
private int field_115_DOP_size;
private int field_116_sttbfassoc_offset;
- private int field_117_sttbfassoc_size;
+ private int field_117_sttbfassoc_size; */
/**offset in table stream of beginning of information for complex files.
- * Also, this is the beginning of the Text piece table*/
+ * Also, this is the beginning of the Text piece table*/ /*
private int field_118_textPieceTable_offset;
private int field_119_textPieceTable_size;
private int field_199_list_format_offset;
-
-
- /** Creates a new instance of FileInformationBlock */
+^/
+ /** Creates a new instance of FileInformationBlock */
public FileInformationBlock(byte[] mainDocument)
{
- field_1_id = LittleEndian.getShort(mainDocument, 0);
+ fillFields(mainDocument, (short)0, (short)0);
+/* field_1_id = LittleEndian.getShort(mainDocument, 0);
field_2_version = LittleEndian.getShort(mainDocument, 0x2); // 101 = Word 6.0 +
field_3_product_version = LittleEndian.getShort(mainDocument, 0x4);
field_4_language_stamp = LittleEndian.getShort(mainDocument, 0x6);
field_199_list_format_offset = LittleEndian.getInt(mainDocument, 0x2e2);
field_200_list_format_size = LittleEndian.getInt(mainDocument, 0x2e6);
field_201_list_format_override_offset = LittleEndian.getInt(mainDocument, 0x2ea);
- field_202_list_format_override_size= LittleEndian.getInt(mainDocument, 0x2ee);
+ field_202_list_format_override_size= LittleEndian.getInt(mainDocument, 0x2ee);*/
}
-
+/*
public boolean useTable1()
{
return tabletype.setShort(field_6_options) > 0;
{
return field_202_list_format_override_size;
}
-
+*/
}