mirror of https://github.com/apache/poi.git
Made everything work with the abstract type
PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352279 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2606284655
commit
a50cd7fdc5
|
@ -119,7 +119,7 @@ public class HDFObjectFactory
|
|||
private void initTableStream() throws IOException
|
||||
{
|
||||
String tablename = null;
|
||||
if(_fib.useTable1())
|
||||
if(_fib.isTabletype())
|
||||
{
|
||||
tablename="1Table";
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ public class HDFObjectFactory
|
|||
*/
|
||||
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
|
||||
|
@ -207,8 +207,8 @@ public class HDFObjectFactory
|
|||
*/
|
||||
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;
|
||||
|
||||
|
@ -256,8 +256,8 @@ public class HDFObjectFactory
|
|||
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
|
||||
|
@ -301,9 +301,9 @@ public class HDFObjectFactory
|
|||
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);
|
||||
|
||||
|
@ -339,8 +339,8 @@ public class HDFObjectFactory
|
|||
*/
|
||||
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);
|
||||
|
||||
|
@ -351,13 +351,13 @@ public class HDFObjectFactory
|
|||
*/
|
||||
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
|
||||
|
@ -375,8 +375,8 @@ public class HDFObjectFactory
|
|||
*/
|
||||
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);
|
||||
|
|
|
@ -4,15 +4,15 @@ import org.apache.poi.util.BitField;
|
|||
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;
|
||||
|
@ -77,23 +77,23 @@ public class FileInformationBlock //extends FIBAbstractType
|
|||
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
|
||||
|
@ -101,8 +101,9 @@ public class FileInformationBlock //extends FIBAbstractType
|
|||
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;
|
||||
|
@ -115,9 +116,9 @@ public class FileInformationBlock //extends FIBAbstractType
|
|||
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;
|
||||
|
@ -168,9 +169,9 @@ public class FileInformationBlock //extends FIBAbstractType
|
|||
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;
|
||||
|
@ -181,12 +182,12 @@ public class FileInformationBlock //extends FIBAbstractType
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
/** 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);
|
||||
|
@ -219,10 +220,10 @@ public class FileInformationBlock //extends FIBAbstractType
|
|||
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;
|
||||
|
@ -299,7 +300,7 @@ public class FileInformationBlock //extends FIBAbstractType
|
|||
{
|
||||
return field_202_list_format_override_size;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue