2002-05-11 19:13:42 +00:00
|
|
|
/*
|
|
|
|
|
* ====================================================================
|
|
|
|
|
* The Apache Software License, Version 1.1
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* Copyright (c) 2002 The Apache Software Foundation. All rights
|
|
|
|
|
* reserved.
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
|
* are met:
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer in
|
|
|
|
|
* the documentation and/or other materials provided with the
|
|
|
|
|
* distribution.
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* 3. The end-user documentation included with the redistribution,
|
|
|
|
|
* if any, must include the following acknowledgment:
|
|
|
|
|
* "This product includes software developed by the
|
|
|
|
|
* Apache Software Foundation (http://www.apache.org/)."
|
|
|
|
|
* Alternately, this acknowledgment may appear in the software itself,
|
|
|
|
|
* if and wherever such third-party acknowledgments normally appear.
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* 4. The names "Apache" and "Apache Software Foundation" and
|
|
|
|
|
* "Apache POI" must not be used to endorse or promote products
|
|
|
|
|
* derived from this software without prior written permission. For
|
|
|
|
|
* written permission, please contact apache@apache.org.
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* 5. Products derived from this software may not be called "Apache",
|
|
|
|
|
* "Apache POI", nor may "Apache" appear in their name, without
|
|
|
|
|
* prior written permission of the Apache Software Foundation.
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
|
|
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
|
|
|
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
|
|
|
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
|
|
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
|
* ====================================================================
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* This software consists of voluntary contributions made by many
|
|
|
|
|
* individuals on behalf of the Apache Software Foundation. For more
|
|
|
|
|
* information on the Apache Software Foundation, please see
|
|
|
|
|
* <http://www.apache.org/>.
|
2002-01-31 02:22:28 +00:00
|
|
|
*/
|
|
|
|
|
/*
|
2002-05-11 19:13:42 +00:00
|
|
|
* BiffViewer.java
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* Created on November 13, 2001, 9:23 AM
|
2002-01-31 02:22:28 +00:00
|
|
|
*/
|
|
|
|
|
package org.apache.poi.hssf.dev;
|
|
|
|
|
|
2002-03-01 13:05:13 +00:00
|
|
|
import org.apache.poi.hssf.record.*;
|
2002-01-31 02:22:28 +00:00
|
|
|
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
|
|
|
|
import org.apache.poi.util.HexDump;
|
2002-03-01 13:05:13 +00:00
|
|
|
import org.apache.poi.util.LittleEndian;
|
|
|
|
|
|
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
import java.util.ArrayList;
|
2002-01-31 02:22:28 +00:00
|
|
|
|
|
|
|
|
/**
|
2002-05-11 19:13:42 +00:00
|
|
|
* Utillity for reading in BIFF8 records and displaying data from them.
|
|
|
|
|
*
|
|
|
|
|
*@author Andrew C. Oliver (acoliver at apache dot org)
|
|
|
|
|
*@author Glen Stampoultzis (glens at apache.org)
|
|
|
|
|
*@see #main
|
2002-01-31 02:22:28 +00:00
|
|
|
*/
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
public class BiffViewer {
|
2002-04-14 13:54:00 +00:00
|
|
|
String filename;
|
2002-01-31 02:22:28 +00:00
|
|
|
private boolean dump;
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
|
2002-01-31 02:22:28 +00:00
|
|
|
/**
|
2002-05-11 19:13:42 +00:00
|
|
|
* Creates new BiffViewer
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
*@param args
|
2002-01-31 02:22:28 +00:00
|
|
|
*/
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
public BiffViewer(String[] args) {
|
|
|
|
|
if (args.length > 0) {
|
2002-04-14 13:54:00 +00:00
|
|
|
filename = args[0];
|
2002-05-11 19:13:42 +00:00
|
|
|
} else {
|
2002-01-31 02:22:28 +00:00
|
|
|
System.out.println("BIFFVIEWER REQUIRES A FILENAME***");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
|
2002-01-31 02:22:28 +00:00
|
|
|
/**
|
2002-05-11 19:13:42 +00:00
|
|
|
* Method run starts up BiffViewer...
|
2002-01-31 02:22:28 +00:00
|
|
|
*/
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
public void run() {
|
|
|
|
|
try {
|
2002-04-14 13:54:00 +00:00
|
|
|
POIFSFileSystem fs =
|
|
|
|
|
new POIFSFileSystem(new FileInputStream(filename));
|
|
|
|
|
InputStream stream =
|
|
|
|
|
fs.createDocumentInputStream("Workbook");
|
|
|
|
|
Record[] records = createRecords(stream, dump);
|
2002-05-11 19:13:42 +00:00
|
|
|
} catch (Exception e) {
|
2002-01-31 02:22:28 +00:00
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
|
2002-01-31 02:22:28 +00:00
|
|
|
/**
|
2002-05-11 19:13:42 +00:00
|
|
|
* Create an array of records from an input stream
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
*@param in the InputStream from which the records
|
|
|
|
|
* will be obtained
|
|
|
|
|
*@param dump
|
|
|
|
|
*@return an array of Records created from the
|
|
|
|
|
* InputStream
|
|
|
|
|
*@exception RecordFormatException on error processing the InputStream
|
2002-01-31 02:22:28 +00:00
|
|
|
*/
|
|
|
|
|
|
2002-04-14 13:54:00 +00:00
|
|
|
public static Record[] createRecords(InputStream in, boolean dump)
|
2002-05-11 19:13:42 +00:00
|
|
|
throws RecordFormatException {
|
2002-04-14 13:54:00 +00:00
|
|
|
ArrayList records = new ArrayList();
|
|
|
|
|
Record last_record = null;
|
|
|
|
|
int loc = 0;
|
2002-01-31 02:22:28 +00:00
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
try {
|
2002-04-12 14:50:56 +00:00
|
|
|
// long offset = 0;
|
2002-01-31 02:22:28 +00:00
|
|
|
short rectype = 0;
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
do {
|
2002-01-31 02:22:28 +00:00
|
|
|
rectype = LittleEndian.readShort(in);
|
2002-04-12 14:50:56 +00:00
|
|
|
System.out.println("============================================");
|
2002-04-14 13:54:00 +00:00
|
|
|
System.out.println("Offset 0x" + Integer.toHexString(loc) + " (" + loc + ")");
|
|
|
|
|
loc += 2;
|
2002-05-11 19:13:42 +00:00
|
|
|
if (rectype != 0) {
|
2002-01-31 02:22:28 +00:00
|
|
|
short recsize = LittleEndian.readShort(in);
|
|
|
|
|
|
|
|
|
|
loc += 2;
|
2002-04-14 13:54:00 +00:00
|
|
|
byte[] data = new byte[(int) recsize];
|
2002-01-31 02:22:28 +00:00
|
|
|
|
|
|
|
|
in.read(data);
|
2002-05-11 19:13:42 +00:00
|
|
|
if ((rectype == WSBoolRecord.sid) && (recsize == 0)) {
|
2002-01-31 02:22:28 +00:00
|
|
|
System.out.println(loc);
|
|
|
|
|
}
|
2002-04-14 13:54:00 +00:00
|
|
|
loc += recsize;
|
2002-04-12 14:50:56 +00:00
|
|
|
// offset += 4 + recsize;
|
2002-05-11 19:13:42 +00:00
|
|
|
if (dump) {
|
2002-04-14 13:54:00 +00:00
|
|
|
dump(rectype, recsize, data);
|
2002-01-31 02:22:28 +00:00
|
|
|
}
|
|
|
|
|
Record[] recs = createRecord(rectype, recsize,
|
2002-05-11 19:13:42 +00:00
|
|
|
data);
|
|
|
|
|
// handle MulRK records
|
2002-01-31 02:22:28 +00:00
|
|
|
|
2002-04-14 13:54:00 +00:00
|
|
|
Record record = recs[0];
|
|
|
|
|
|
|
|
|
|
if ((record instanceof UnknownRecord)
|
2002-05-11 19:13:42 +00:00
|
|
|
&& !dump) {
|
|
|
|
|
// if we didn't already dump
|
|
|
|
|
// just cause dump was on and we're hit an unknow
|
2002-04-14 13:54:00 +00:00
|
|
|
dumpUnknownRecord(data);
|
2002-01-31 02:22:28 +00:00
|
|
|
}
|
2002-05-11 19:13:42 +00:00
|
|
|
if (record != null) {
|
|
|
|
|
if (rectype == ContinueRecord.sid) {
|
2002-04-14 13:54:00 +00:00
|
|
|
dumpContinueRecord(last_record, dump, data);
|
2002-05-11 19:13:42 +00:00
|
|
|
} else {
|
2002-04-14 13:54:00 +00:00
|
|
|
last_record = record;
|
|
|
|
|
records.add(record);
|
2002-01-31 02:22:28 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-04-14 13:54:00 +00:00
|
|
|
} while (rectype != 0);
|
2002-05-11 19:13:42 +00:00
|
|
|
} catch (IOException e) {
|
2002-01-31 02:22:28 +00:00
|
|
|
throw new RecordFormatException("Error reading bytes");
|
|
|
|
|
}
|
2002-04-14 13:54:00 +00:00
|
|
|
Record[] retval = new Record[records.size()];
|
2002-01-31 02:22:28 +00:00
|
|
|
|
2002-04-14 13:54:00 +00:00
|
|
|
retval = (Record[]) records.toArray(retval);
|
2002-01-31 02:22:28 +00:00
|
|
|
return retval;
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Description of the Method
|
|
|
|
|
*
|
|
|
|
|
*@param last_record Description of the Parameter
|
|
|
|
|
*@param dump Description of the Parameter
|
|
|
|
|
*@param data Description of the Parameter
|
|
|
|
|
*@exception IOException Description of the Exception
|
|
|
|
|
*/
|
|
|
|
|
private static void dumpContinueRecord(Record last_record, boolean dump, byte[] data) throws IOException {
|
|
|
|
|
if (last_record == null) {
|
2002-04-14 13:54:00 +00:00
|
|
|
throw new RecordFormatException(
|
|
|
|
|
"First record is a ContinueRecord??");
|
|
|
|
|
}
|
2002-05-11 19:13:42 +00:00
|
|
|
if (dump) {
|
2002-04-14 13:54:00 +00:00
|
|
|
System.out.println(
|
|
|
|
|
"-----PRECONTINUED LAST RECORD WOULD SERIALIZE LIKE:");
|
|
|
|
|
byte[] lr = last_record.serialize();
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
if (lr != null) {
|
2002-04-14 13:54:00 +00:00
|
|
|
HexDump.dump(last_record.serialize(),
|
|
|
|
|
0, System.out, 0);
|
|
|
|
|
}
|
|
|
|
|
System.out.println();
|
|
|
|
|
System.out.println(
|
|
|
|
|
"-----PRECONTINUED----------------------------------");
|
|
|
|
|
}
|
|
|
|
|
last_record.processContinueRecord(data);
|
2002-05-11 19:13:42 +00:00
|
|
|
if (dump) {
|
2002-04-14 13:54:00 +00:00
|
|
|
System.out.println(
|
|
|
|
|
"-----CONTINUED LAST RECORD WOULD SERIALIZE LIKE:");
|
|
|
|
|
HexDump.dump(last_record.serialize(), 0,
|
|
|
|
|
System.out, 0);
|
|
|
|
|
System.out.println();
|
|
|
|
|
System.out.println(
|
|
|
|
|
"-----CONTINUED----------------------------------");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Description of the Method
|
|
|
|
|
*
|
|
|
|
|
*@param data Description of the Parameter
|
|
|
|
|
*@exception IOException Description of the Exception
|
|
|
|
|
*/
|
|
|
|
|
private static void dumpUnknownRecord(byte[] data) throws IOException {
|
2002-04-14 13:54:00 +00:00
|
|
|
// record hex dump it!
|
|
|
|
|
System.out.println(
|
|
|
|
|
"-----UNKNOWN----------------------------------");
|
2002-05-11 19:13:42 +00:00
|
|
|
if (data.length > 0) {
|
2002-04-14 13:54:00 +00:00
|
|
|
HexDump.dump(data, 0, System.out, 0);
|
2002-05-11 19:13:42 +00:00
|
|
|
} else {
|
2002-04-14 13:54:00 +00:00
|
|
|
System.out.print("**NO RECORD DATA**");
|
|
|
|
|
}
|
|
|
|
|
System.out.println();
|
|
|
|
|
System.out.println(
|
|
|
|
|
"-----UNKNOWN----------------------------------");
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
|
2002-07-29 13:25:46 +00:00
|
|
|
private static void dump( short rectype, short recsize, byte[] data ) throws IOException
|
|
|
|
|
{
|
|
|
|
|
// System.out
|
|
|
|
|
// .println("fixing to recordize the following");
|
|
|
|
|
System.out.print( "rectype = 0x"
|
|
|
|
|
+ Integer.toHexString( rectype ) );
|
|
|
|
|
System.out.println( ", recsize = 0x"
|
|
|
|
|
+ Integer.toHexString( recsize ) );
|
2002-04-14 13:54:00 +00:00
|
|
|
System.out.println(
|
2002-07-29 13:25:46 +00:00
|
|
|
"-BEGIN DUMP---------------------------------" );
|
|
|
|
|
if ( data.length > 0 )
|
|
|
|
|
{
|
|
|
|
|
HexDump.dump( data, 0, System.out, 0 );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
System.out.println( "**NO RECORD DATA**" );
|
2002-04-14 13:54:00 +00:00
|
|
|
}
|
2002-07-29 13:25:46 +00:00
|
|
|
// System.out.println();
|
2002-04-14 13:54:00 +00:00
|
|
|
System.out.println(
|
2002-07-29 13:25:46 +00:00
|
|
|
"-END DUMP-----------------------------------" );
|
2002-04-14 13:54:00 +00:00
|
|
|
}
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
|
2002-01-31 02:22:28 +00:00
|
|
|
/**
|
2002-05-11 19:13:42 +00:00
|
|
|
* Essentially a duplicate of RecordFactory. Kept seperate as not to screw
|
|
|
|
|
* up non-debug operations.
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
*@param rectype Description of the Parameter
|
|
|
|
|
*@param size Description of the Parameter
|
|
|
|
|
*@param data Description of the Parameter
|
|
|
|
|
*@return Description of the Return Value
|
2002-01-31 02:22:28 +00:00
|
|
|
*/
|
|
|
|
|
|
2002-07-29 13:25:46 +00:00
|
|
|
private static Record[] createRecord( short rectype, short size,
|
|
|
|
|
byte[] data )
|
|
|
|
|
{
|
2002-04-14 13:54:00 +00:00
|
|
|
Record retval = null;
|
2002-01-31 02:22:28 +00:00
|
|
|
Record[] realretval = null;
|
|
|
|
|
|
|
|
|
|
// int irectype = rectype;
|
2002-07-29 13:25:46 +00:00
|
|
|
switch ( rectype )
|
|
|
|
|
{
|
2002-01-31 02:22:28 +00:00
|
|
|
|
2002-04-14 13:54:00 +00:00
|
|
|
case ChartRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new ChartRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case ChartFormatRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new ChartFormatRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case SeriesRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new SeriesRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case BeginRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new BeginRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case EndRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new EndRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case BOFRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new BOFRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case InterfaceHdrRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new InterfaceHdrRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case MMSRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new MMSRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case InterfaceEndRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new InterfaceEndRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case WriteAccessRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new WriteAccessRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case CodepageRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new CodepageRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case DSFRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new DSFRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case TabIdRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new TabIdRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case FnGroupCountRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new FnGroupCountRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case WindowProtectRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new WindowProtectRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case ProtectRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new ProtectRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case PasswordRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new PasswordRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case ProtectionRev4Record.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new ProtectionRev4Record( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case PasswordRev4Record.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new PasswordRev4Record( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case WindowOneRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new WindowOneRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case BackupRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new BackupRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case HideObjRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new HideObjRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case DateWindow1904Record.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new DateWindow1904Record( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case PrecisionRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new PrecisionRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case RefreshAllRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new RefreshAllRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case BookBoolRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new BookBoolRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case FontRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new FontRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case FormatRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new FormatRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case ExtendedFormatRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new ExtendedFormatRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case StyleRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new StyleRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case UseSelFSRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new UseSelFSRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case BoundSheetRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new BoundSheetRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case CountryRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new CountryRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case SSTRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new SSTRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case ExtSSTRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new ExtSSTRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case EOFRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new EOFRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case IndexRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new IndexRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case CalcModeRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new CalcModeRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case CalcCountRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new CalcCountRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case RefModeRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new RefModeRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case IterationRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new IterationRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case DeltaRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new DeltaRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case SaveRecalcRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new SaveRecalcRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case PrintHeadersRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new PrintHeadersRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case PrintGridlinesRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new PrintGridlinesRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case GridsetRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new GridsetRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case GutsRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new GutsRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case DefaultRowHeightRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new DefaultRowHeightRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case WSBoolRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new WSBoolRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case HeaderRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new HeaderRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case FooterRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new FooterRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case HCenterRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new HCenterRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case VCenterRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new VCenterRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case PrintSetupRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new PrintSetupRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case DefaultColWidthRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new DefaultColWidthRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case DimensionsRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new DimensionsRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case RowRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new RowRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case LabelSSTRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new LabelSSTRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case RKRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new RKRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case NumberRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new NumberRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case DBCellRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new DBCellRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case WindowTwoRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new WindowTwoRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case SelectionRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new SelectionRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case ContinueRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new ContinueRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case LabelRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new LabelRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case MulRKRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new MulRKRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case MulBlankRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new MulBlankRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case BlankRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new BlankRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case BoolErrRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new BoolErrRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case ColumnInfoRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new ColumnInfoRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case MergeCellsRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new MergeCellsRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case AreaRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new AreaRecord( rectype, size, data );
|
2002-02-10 04:32:07 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case DataFormatRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new DataFormatRecord( rectype, size, data );
|
2002-02-10 04:32:07 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case BarRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new BarRecord( rectype, size, data );
|
2002-02-10 05:24:51 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case DatRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new DatRecord( rectype, size, data );
|
2002-02-10 05:24:51 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case PlotGrowthRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new PlotGrowthRecord( rectype, size, data );
|
2002-02-10 05:24:51 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case UnitsRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new UnitsRecord( rectype, size, data );
|
2002-02-10 05:24:51 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case FrameRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new FrameRecord( rectype, size, data );
|
2002-02-10 05:24:51 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case ValueRangeRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new ValueRangeRecord( rectype, size, data );
|
2002-03-08 15:07:30 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case SeriesListRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new SeriesListRecord( rectype, size, data );
|
2002-03-09 11:17:12 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case FontBasisRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new FontBasisRecord( rectype, size, data );
|
2002-03-09 11:17:12 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case FontIndexRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new FontIndexRecord( rectype, size, data );
|
2002-03-04 00:05:33 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case LineFormatRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new LineFormatRecord( rectype, size, data );
|
2002-04-14 12:43:57 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case AreaFormatRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new AreaFormatRecord( rectype, size, data );
|
2002-04-14 12:43:57 +00:00
|
|
|
break;
|
2002-04-14 13:54:00 +00:00
|
|
|
case LinkedDataRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new LinkedDataRecord( rectype, size, data );
|
2002-04-14 12:43:57 +00:00
|
|
|
break;
|
2002-04-17 22:21:16 +00:00
|
|
|
case FormulaRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new FormulaRecord( rectype, size, data );
|
2002-04-17 22:21:16 +00:00
|
|
|
break;
|
2002-04-22 07:12:26 +00:00
|
|
|
case SheetPropertiesRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new SheetPropertiesRecord( rectype, size, data );
|
2002-04-22 07:12:26 +00:00
|
|
|
break;
|
2002-05-01 08:02:19 +00:00
|
|
|
case DefaultDataLabelTextPropertiesRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new DefaultDataLabelTextPropertiesRecord( rectype, size, data );
|
2002-05-01 08:02:19 +00:00
|
|
|
break;
|
|
|
|
|
case TextRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new TextRecord( rectype, size, data );
|
2002-05-01 08:02:19 +00:00
|
|
|
break;
|
|
|
|
|
case AxisParentRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new AxisParentRecord( rectype, size, data );
|
2002-05-01 08:02:19 +00:00
|
|
|
break;
|
|
|
|
|
case AxisLineFormatRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new AxisLineFormatRecord( rectype, size, data );
|
2002-05-01 08:02:19 +00:00
|
|
|
break;
|
2002-05-07 23:38:06 +00:00
|
|
|
case SupBookRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new SupBookRecord( rectype, size, data );
|
2002-05-07 23:38:06 +00:00
|
|
|
break;
|
|
|
|
|
case ExternSheetRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new ExternSheetRecord( rectype, size, data );
|
2002-05-07 23:38:06 +00:00
|
|
|
break;
|
2002-05-08 01:46:11 +00:00
|
|
|
case SCLRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new SCLRecord( rectype, size, data );
|
2002-05-08 01:46:11 +00:00
|
|
|
break;
|
|
|
|
|
case SeriesToChartGroupRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new SeriesToChartGroupRecord( rectype, size, data );
|
2002-05-08 01:46:11 +00:00
|
|
|
break;
|
2002-05-11 19:13:42 +00:00
|
|
|
case AxisUsedRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new AxisUsedRecord( rectype, size, data );
|
2002-05-11 19:13:42 +00:00
|
|
|
break;
|
|
|
|
|
case AxisRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new AxisRecord( rectype, size, data );
|
2002-05-11 19:13:42 +00:00
|
|
|
break;
|
|
|
|
|
case CategorySeriesAxisRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new CategorySeriesAxisRecord( rectype, size, data );
|
|
|
|
|
break;
|
2002-05-11 19:13:42 +00:00
|
|
|
case AxisOptionsRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new AxisOptionsRecord( rectype, size, data );
|
2002-05-11 19:13:42 +00:00
|
|
|
break;
|
|
|
|
|
case TickRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new TickRecord( rectype, size, data );
|
2002-05-11 19:13:42 +00:00
|
|
|
break;
|
2002-05-18 16:21:01 +00:00
|
|
|
case SeriesTextRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new SeriesTextRecord( rectype, size, data );
|
2002-05-18 16:21:01 +00:00
|
|
|
break;
|
|
|
|
|
case ObjectLinkRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new ObjectLinkRecord( rectype, size, data );
|
2002-05-18 16:21:01 +00:00
|
|
|
break;
|
2002-05-19 15:51:48 +00:00
|
|
|
case PlotAreaRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new PlotAreaRecord( rectype, size, data );
|
2002-05-19 15:51:48 +00:00
|
|
|
break;
|
2002-05-19 18:48:52 +00:00
|
|
|
case SeriesIndexRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new SeriesIndexRecord( rectype, size, data );
|
2002-05-19 18:48:52 +00:00
|
|
|
break;
|
2002-05-19 18:50:37 +00:00
|
|
|
case LegendRecord.sid:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new LegendRecord( rectype, size, data );
|
|
|
|
|
break;
|
|
|
|
|
case LeftMarginRecord.sid:
|
|
|
|
|
retval = new LeftMarginRecord( rectype, size, data );
|
|
|
|
|
break;
|
|
|
|
|
case RightMarginRecord.sid:
|
|
|
|
|
retval = new RightMarginRecord( rectype, size, data );
|
|
|
|
|
break;
|
|
|
|
|
case TopMarginRecord.sid:
|
|
|
|
|
retval = new TopMarginRecord( rectype, size, data );
|
|
|
|
|
break;
|
|
|
|
|
case BottomMarginRecord.sid:
|
|
|
|
|
retval = new BottomMarginRecord( rectype, size, data );
|
|
|
|
|
break;
|
|
|
|
|
case PaletteRecord.sid:
|
|
|
|
|
retval = new PaletteRecord( rectype, size, data );
|
|
|
|
|
break;
|
|
|
|
|
case StringRecord.sid:
|
|
|
|
|
retval = new StringRecord( rectype, size, data );
|
|
|
|
|
break;
|
2002-09-02 02:11:16 +00:00
|
|
|
case NameRecord.sid:
|
|
|
|
|
retval = new NameRecord( rectype, size, data );
|
|
|
|
|
break;
|
2002-05-11 19:13:42 +00:00
|
|
|
default:
|
2002-07-29 13:25:46 +00:00
|
|
|
retval = new UnknownRecord( rectype, size, data );
|
2002-01-31 02:22:28 +00:00
|
|
|
}
|
2002-07-29 13:25:46 +00:00
|
|
|
if ( realretval == null )
|
|
|
|
|
{
|
2002-04-14 13:54:00 +00:00
|
|
|
realretval = new Record[1];
|
|
|
|
|
realretval[0] = retval;
|
2002-07-29 13:25:46 +00:00
|
|
|
System.out.println( "recordid = 0x" + Integer.toHexString( rectype ) + ", size =" + size );
|
|
|
|
|
System.out.println( realretval[0].toString() );
|
2002-01-31 02:22:28 +00:00
|
|
|
}
|
|
|
|
|
return realretval;
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
|
2002-01-31 02:22:28 +00:00
|
|
|
/**
|
2002-05-11 19:13:42 +00:00
|
|
|
* Method setDump - hex dump out data or not.
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
*@param dump
|
2002-01-31 02:22:28 +00:00
|
|
|
*/
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
public void setDump(boolean dump) {
|
2002-01-31 02:22:28 +00:00
|
|
|
this.dump = dump;
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
|
2002-01-31 02:22:28 +00:00
|
|
|
/**
|
2002-05-11 19:13:42 +00:00
|
|
|
* Method main with 1 argument just run straight biffview against given
|
|
|
|
|
* file<P>
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* with 2 arguments where the second argument is "on" - run biffviewer<P>
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* with hex dumps of records <P>
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
* with 2 arguments where the second argument is "bfd" just run a big fat
|
|
|
|
|
* hex dump of the file...don't worry about biffviewing it at all
|
2002-01-31 02:22:28 +00:00
|
|
|
*
|
2002-05-11 19:13:42 +00:00
|
|
|
*@param args
|
2002-01-31 02:22:28 +00:00
|
|
|
*/
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
public static void main(String[] args) {
|
|
|
|
|
try {
|
2002-01-31 02:22:28 +00:00
|
|
|
BiffViewer viewer = new BiffViewer(args);
|
|
|
|
|
|
2002-05-11 19:13:42 +00:00
|
|
|
if ((args.length > 1) && args[1].equals("on")) {
|
2002-01-31 02:22:28 +00:00
|
|
|
viewer.setDump(true);
|
|
|
|
|
}
|
2002-05-11 19:13:42 +00:00
|
|
|
if ((args.length > 1) && args[1].equals("bfd")) {
|
2002-04-14 13:54:00 +00:00
|
|
|
POIFSFileSystem fs =
|
|
|
|
|
new POIFSFileSystem(new FileInputStream(args[0]));
|
|
|
|
|
InputStream stream =
|
|
|
|
|
fs.createDocumentInputStream("Workbook");
|
|
|
|
|
int size = stream.available();
|
|
|
|
|
byte[] data = new byte[size];
|
2002-01-31 02:22:28 +00:00
|
|
|
|
|
|
|
|
stream.read(data);
|
|
|
|
|
HexDump.dump(data, 0, System.out, 0);
|
2002-05-11 19:13:42 +00:00
|
|
|
} else {
|
2002-01-31 02:22:28 +00:00
|
|
|
viewer.run();
|
|
|
|
|
}
|
2002-05-11 19:13:42 +00:00
|
|
|
} catch (Exception e) {
|
2002-01-31 02:22:28 +00:00
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|