diff --git a/src/java/org/apache/poi/hssf/record/CellRecord.java b/src/java/org/apache/poi/hssf/record/CellRecord.java
index 9d9ed4fc9a..7d87101a7c 100644
--- a/src/java/org/apache/poi/hssf/record/CellRecord.java
+++ b/src/java/org/apache/poi/hssf/record/CellRecord.java
@@ -27,106 +27,109 @@ import org.apache.poi.util.LittleEndianOutput;
* @author Josh Micich
*/
public abstract class CellRecord extends StandardRecord implements CellValueRecordInterface {
- private int _rowIndex;
- private int _columnIndex;
- private int _formatIndex;
+ private int _rowIndex;
+ private int _columnIndex;
+ private int _formatIndex;
- protected CellRecord() {
- // fields uninitialised
- }
+ protected CellRecord() {
+ // fields uninitialised
+ }
- protected CellRecord(RecordInputStream in) {
- _rowIndex = in.readUShort();
- _columnIndex = in.readUShort();
- _formatIndex = in.readUShort();
- }
+ protected CellRecord(RecordInputStream in) {
+ _rowIndex = in.readUShort();
+ _columnIndex = in.readUShort();
+ _formatIndex = in.readUShort();
+ }
- public final void setRow(int row) {
- _rowIndex = row;
- }
+ public final void setRow(int row) {
+ _rowIndex = row;
+ }
- public final void setColumn(short col) {
- _columnIndex = col;
- }
+ public final void setColumn(short col) {
+ _columnIndex = col;
+ }
- /**
- * set the index to the ExtendedFormat
- *
- * @see org.apache.poi.hssf.record.ExtendedFormatRecord
- * @param xf index to the XF record
- */
- public final void setXFIndex(short xf) {
- _formatIndex = xf;
- }
+ /**
+ * set the index to the ExtendedFormat
+ *
+ * @see org.apache.poi.hssf.record.ExtendedFormatRecord
+ * @param xf index to the XF record
+ */
+ public final void setXFIndex(short xf) {
+ _formatIndex = xf;
+ }
- public final int getRow() {
- return _rowIndex;
- }
+ public final int getRow() {
+ return _rowIndex;
+ }
- public final short getColumn() {
- return (short) _columnIndex;
- }
+ public final short getColumn() {
+ return (short) _columnIndex;
+ }
- /**
- * get the index to the ExtendedFormat
- *
- * @see org.apache.poi.hssf.record.ExtendedFormatRecord
- * @return index to the XF record
- */
- public final short getXFIndex() {
- return (short) _formatIndex;
- }
+ /**
+ * get the index to the ExtendedFormat
+ *
+ * @see org.apache.poi.hssf.record.ExtendedFormatRecord
+ * @return index to the XF record
+ */
+ public final short getXFIndex() {
+ return (short) _formatIndex;
+ }
- public final String toString() {
- StringBuilder sb = new StringBuilder();
- String recordName = getRecordName();
+ @Override
+ public final String toString() {
+ StringBuilder sb = new StringBuilder();
+ String recordName = getRecordName();
- sb.append("[").append(recordName).append("]\n");
- sb.append(" .row = ").append(HexDump.shortToHex(getRow())).append("\n");
- sb.append(" .col = ").append(HexDump.shortToHex(getColumn())).append("\n");
- sb.append(" .xfindex= ").append(HexDump.shortToHex(getXFIndex())).append("\n");
- appendValueText(sb);
- sb.append("\n");
- sb.append("[/").append(recordName).append("]\n");
- return sb.toString();
- }
+ sb.append("[").append(recordName).append("]\n");
+ sb.append(" .row = ").append(HexDump.shortToHex(getRow())).append("\n");
+ sb.append(" .col = ").append(HexDump.shortToHex(getColumn())).append("\n");
+ sb.append(" .xfindex= ").append(HexDump.shortToHex(getXFIndex())).append("\n");
+ appendValueText(sb);
+ sb.append("\n");
+ sb.append("[/").append(recordName).append("]\n");
+ return sb.toString();
+ }
- /**
- * Append specific debug info (used by {@link #toString()} for the value
- * contained in this record. Trailing new-line should not be appended
- * (superclass does that).
- */
- protected abstract void appendValueText(StringBuilder sb);
+ /**
+ * Append specific debug info (used by {@link #toString()} for the value
+ * contained in this record. Trailing new-line should not be appended
+ * (superclass does that).
+ */
+ protected abstract void appendValueText(StringBuilder sb);
- /**
- * Gets the debug info BIFF record type name (used by {@link #toString()}.
- */
- protected abstract String getRecordName();
+ /**
+ * Gets the debug info BIFF record type name (used by {@link #toString()}.
+ */
+ protected abstract String getRecordName();
- /**
- * writes out the value data for this cell record
- */
- protected abstract void serializeValue(LittleEndianOutput out);
+ /**
+ * writes out the value data for this cell record
+ */
+ protected abstract void serializeValue(LittleEndianOutput out);
- /**
- * @return the size (in bytes) of the value data for this cell record
- */
- protected abstract int getValueDataSize();
+ /**
+ * @return the size (in bytes) of the value data for this cell record
+ */
+ protected abstract int getValueDataSize();
- public final void serialize(LittleEndianOutput out) {
- out.writeShort(getRow());
- out.writeShort(getColumn());
- out.writeShort(getXFIndex());
- serializeValue(out);
- }
+ @Override
+ public final void serialize(LittleEndianOutput out) {
+ out.writeShort(getRow());
+ out.writeShort(getColumn());
+ out.writeShort(getXFIndex());
+ serializeValue(out);
+ }
- protected final int getDataSize() {
- return 6 + getValueDataSize();
- }
+ @Override
+ protected final int getDataSize() {
+ return 6 + getValueDataSize();
+ }
- protected final void copyBaseFields(CellRecord rec) {
- rec._rowIndex = _rowIndex;
- rec._columnIndex = _columnIndex;
- rec._formatIndex = _formatIndex;
- }
+ protected final void copyBaseFields(CellRecord rec) {
+ rec._rowIndex = _rowIndex;
+ rec._columnIndex = _columnIndex;
+ rec._formatIndex = _formatIndex;
+ }
}
diff --git a/src/java/org/apache/poi/hssf/record/ExternalNameRecord.java b/src/java/org/apache/poi/hssf/record/ExternalNameRecord.java
index 0990009f05..0363b00837 100644
--- a/src/java/org/apache/poi/hssf/record/ExternalNameRecord.java
+++ b/src/java/org/apache/poi/hssf/record/ExternalNameRecord.java
@@ -124,6 +124,7 @@ public final class ExternalNameRecord extends StandardRecord {
}
+ @Override
protected int getDataSize(){
int result = 2 + 4; // short and int
result += StringUtil.getEncodedSize(field_4_name) - 1; //size is byte, not short
@@ -141,6 +142,7 @@ public final class ExternalNameRecord extends StandardRecord {
return result;
}
+ @Override
public void serialize(LittleEndianOutput out) {
out.writeShort(field_1_option_flag);
out.writeShort(field_2_ixals);
@@ -198,10 +200,12 @@ public final class ExternalNameRecord extends StandardRecord {
}
}
+ @Override
public short getSid() {
return sid;
}
+ @Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("[EXTERNALNAME]\n");
diff --git a/src/java/org/apache/poi/hssf/record/NumberRecord.java b/src/java/org/apache/poi/hssf/record/NumberRecord.java
index 7380165c91..a156863aa8 100644
--- a/src/java/org/apache/poi/hssf/record/NumberRecord.java
+++ b/src/java/org/apache/poi/hssf/record/NumberRecord.java
@@ -81,10 +81,12 @@ public final class NumberRecord extends CellRecord {
return 8;
}
+ @Override
public short getSid() {
return sid;
}
+ @Override
public Object clone() {
NumberRecord rec = new NumberRecord();
copyBaseFields(rec);
diff --git a/src/java/org/apache/poi/hssf/record/Record.java b/src/java/org/apache/poi/hssf/record/Record.java
index 65da3cd33a..b81a666f00 100644
--- a/src/java/org/apache/poi/hssf/record/Record.java
+++ b/src/java/org/apache/poi/hssf/record/Record.java
@@ -28,69 +28,71 @@ import java.io.ByteArrayInputStream;
*/
public abstract class Record extends RecordBase {
- protected Record() {
- // no fields to initialise
- }
+ protected Record() {
+ // no fields to initialise
+ }
- /**
- * called by the class that is responsible for writing this sucker.
- * Subclasses should implement this so that their data is passed back in a
- * byte array.
- *
- * @return byte array containing instance data
- */
- public final byte[] serialize() {
- byte[] retval = new byte[ getRecordSize() ];
+ /**
+ * called by the class that is responsible for writing this sucker.
+ * Subclasses should implement this so that their data is passed back in a
+ * byte array.
+ *
+ * @return byte array containing instance data
+ */
+ public final byte[] serialize() {
+ byte[] retval = new byte[ getRecordSize() ];
- serialize(0, retval);
- return retval;
- }
+ serialize(0, retval);
+ return retval;
+ }
- /**
- * get a string representation of the record (for biffview/debugging)
- */
- public String toString() {
- return super.toString();
- }
+ /**
+ * get a string representation of the record (for biffview/debugging)
+ */
+ @Override
+ public String toString() {
+ return super.toString();
+ }
- /**
- * return the non static version of the id for this record.
- */
+ /**
+ * return the non static version of the id for this record.
+ */
- public abstract short getSid();
+ public abstract short getSid();
- public Object clone() {
- if (false) {
- // TODO - implement clone in a more standardised way
- try {
- return super.clone();
- } catch (CloneNotSupportedException e) {
- throw new RuntimeException(e);
- }
- }
- throw new RuntimeException("The class "+getClass().getName()+" needs to define a clone method");
- }
+ @Override
+ public Object clone() {
+ if (false) {
+ // TODO - implement clone in a more standardised way
+ try {
+ return super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ throw new RuntimeException("The class "+getClass().getName()+" needs to define a clone method");
+ }
- /**
- * Clone the current record, via a call to serialize
- * it, and another to create a new record from the
- * bytes.
- * May only be used for classes which don't have
- * internal counts / ids in them. For those which
- * do, a full model-aware cloning is needed, which
- * allocates new ids / counts as needed.
- */
- public Record cloneViaReserialise() {
- // Do it via a re-serialization
- // It's a cheat, but it works...
- byte[] b = serialize();
- RecordInputStream rinp = new RecordInputStream(new ByteArrayInputStream(b));
- rinp.nextRecord();
+ /**
+ * Clone the current record, via a call to serialize
+ * it, and another to create a new record from the
+ * bytes.
+ * May only be used for classes which don't have
+ * internal counts / ids in them. For those which
+ * do, a full model-aware cloning is needed, which
+ * allocates new ids / counts as needed.
+ */
+ public Record cloneViaReserialise() {
+ // Do it via a re-serialization
+ // It's a cheat, but it works...
+ byte[] b = serialize();
+ RecordInputStream rinp = new RecordInputStream(new ByteArrayInputStream(b));
+ rinp.nextRecord();
- Record[] r = RecordFactory.createRecord(rinp);
- if(r.length != 1) {
- throw new IllegalStateException("Re-serialised a record to clone it, but got " + r.length + " records back!");
- }
- return r[0];
- }
+ Record[] r = RecordFactory.createRecord(rinp);
+ if(r.length != 1) {
+ throw new IllegalStateException("Re-serialised a record to clone it, but got " + r.length + " records back!");
+ }
+ return r[0];
+ }
}
diff --git a/src/java/org/apache/poi/hssf/record/UnknownRecord.java b/src/java/org/apache/poi/hssf/record/UnknownRecord.java
index 4231a659d3..6b46247e23 100644
--- a/src/java/org/apache/poi/hssf/record/UnknownRecord.java
+++ b/src/java/org/apache/poi/hssf/record/UnknownRecord.java
@@ -33,254 +33,259 @@ import org.apache.poi.util.LittleEndianOutput;
*/
public final class UnknownRecord extends StandardRecord {
- /*
- * Some Record IDs used by POI as 'milestones' in the record stream
- */
- /**
- * seems to be part of the {@link PageSettingsBlock}. Not interpreted by POI.
- * The name 'PRINTSIZE' was taken from OOO source.
- * The few POI test samples with this record have data { 0x03, 0x00 }.
- */
- public static final int PRINTSIZE_0033 = 0x0033;
- /**
- * Environment-Specific Print Record
- */
- public static final int PLS_004D = 0x004D;
- public static final int SHEETPR_0081 = 0x0081;
- public static final int SORT_0090 = 0x0090;
- public static final int STANDARDWIDTH_0099 = 0x0099;
- public static final int SCL_00A0 = 0x00A0;
- public static final int BITMAP_00E9 = 0x00E9;
- public static final int PHONETICPR_00EF = 0x00EF;
- public static final int LABELRANGES_015F = 0x015F;
- public static final int QUICKTIP_0800 = 0x0800;
- public static final int SHEETEXT_0862 = 0x0862; // OOO calls this SHEETLAYOUT
- public static final int SHEETPROTECTION_0867 = 0x0867;
- public static final int HEADER_FOOTER_089C = 0x089C;
- public static final int CODENAME_1BA = 0x01BA;
- public static final int PLV_MAC = 0x08C8;
+ /*
+ * Some Record IDs used by POI as 'milestones' in the record stream
+ */
+ /**
+ * seems to be part of the {@link PageSettingsBlock}. Not interpreted by POI.
+ * The name 'PRINTSIZE' was taken from OOO source.
+ * The few POI test samples with this record have data { 0x03, 0x00 }.
+ */
+ public static final int PRINTSIZE_0033 = 0x0033;
+ /**
+ * Environment-Specific Print Record
+ */
+ public static final int PLS_004D = 0x004D;
+ public static final int SHEETPR_0081 = 0x0081;
+ public static final int SORT_0090 = 0x0090;
+ public static final int STANDARDWIDTH_0099 = 0x0099;
+ public static final int SCL_00A0 = 0x00A0;
+ public static final int BITMAP_00E9 = 0x00E9;
+ public static final int PHONETICPR_00EF = 0x00EF;
+ public static final int LABELRANGES_015F = 0x015F;
+ public static final int QUICKTIP_0800 = 0x0800;
+ public static final int SHEETEXT_0862 = 0x0862; // OOO calls this SHEETLAYOUT
+ public static final int SHEETPROTECTION_0867 = 0x0867;
+ public static final int HEADER_FOOTER_089C = 0x089C;
+ public static final int CODENAME_1BA = 0x01BA;
+ public static final int PLV_MAC = 0x08C8;
- private int _sid;
- private byte[] _rawData;
+ private int _sid;
+ private byte[] _rawData;
- /**
- * @param id id of the record -not validated, just stored for serialization
- * @param data the data
- */
- public UnknownRecord(int id, byte[] data) {
- _sid = id & 0xFFFF;
- _rawData = data;
- }
+ /**
+ * @param id id of the record -not validated, just stored for serialization
+ * @param data the data
+ */
+ public UnknownRecord(int id, byte[] data) {
+ _sid = id & 0xFFFF;
+ _rawData = data;
+ }
- /**
- * construct an unknown record. No fields are interpreted and the record will
- * be serialized in its original form more or less
- * @param in the RecordInputstream to read the record from
- */
- public UnknownRecord(RecordInputStream in) {
- _sid = in.getSid();
- _rawData = in.readRemainder();
- if (false && getBiffName(_sid) == null) {
- // unknown sids in the range 0x0004-0x0013 are probably 'sub-records' of ObjectRecord
- // those sids are in a different number space.
- // TODO - put unknown OBJ sub-records in a different class
- System.out.println("Unknown record 0x" + Integer.toHexString(_sid).toUpperCase());
- }
- }
+ /**
+ * construct an unknown record. No fields are interpreted and the record will
+ * be serialized in its original form more or less
+ * @param in the RecordInputstream to read the record from
+ */
+ public UnknownRecord(RecordInputStream in) {
+ _sid = in.getSid();
+ _rawData = in.readRemainder();
+ if (false && getBiffName(_sid) == null) {
+ // unknown sids in the range 0x0004-0x0013 are probably 'sub-records' of ObjectRecord
+ // those sids are in a different number space.
+ // TODO - put unknown OBJ sub-records in a different class
+ System.out.println("Unknown record 0x" + Integer.toHexString(_sid).toUpperCase());
+ }
+ }
- /**
- * spit the record out AS IS. no interpretation or identification
- */
- public void serialize(LittleEndianOutput out) {
- out.write(_rawData);
- }
+ /**
+ * spit the record out AS IS. no interpretation or identification
+ */
+ @Override
+ public void serialize(LittleEndianOutput out) {
+ out.write(_rawData);
+ }
- protected int getDataSize() {
- return _rawData.length;
- }
+ @Override
+ protected int getDataSize() {
+ return _rawData.length;
+ }
- /**
- * print a sort of string representation ([UNKNOWN RECORD] id = x [/UNKNOWN RECORD])
- */
- public String toString() {
- String biffName = getBiffName(_sid);
- if (biffName == null) {
- biffName = "UNKNOWNRECORD";
- }
- StringBuffer sb = new StringBuffer();
+ /**
+ * print a sort of string representation ([UNKNOWN RECORD] id = x [/UNKNOWN RECORD])
+ */
+ @Override
+ public String toString() {
+ String biffName = getBiffName(_sid);
+ if (biffName == null) {
+ biffName = "UNKNOWNRECORD";
+ }
+ StringBuffer sb = new StringBuffer();
- sb.append("[").append(biffName).append("] (0x");
- sb.append(Integer.toHexString(_sid).toUpperCase() + ")\n");
- if (_rawData.length > 0) {
- sb.append(" rawData=").append(HexDump.toHex(_rawData)).append("\n");
- }
- sb.append("[/").append(biffName).append("]\n");
- return sb.toString();
- }
+ sb.append("[").append(biffName).append("] (0x");
+ sb.append(Integer.toHexString(_sid).toUpperCase() + ")\n");
+ if (_rawData.length > 0) {
+ sb.append(" rawData=").append(HexDump.toHex(_rawData)).append("\n");
+ }
+ sb.append("[/").append(biffName).append("]\n");
+ return sb.toString();
+ }
- public short getSid() {
- return (short) _sid;
- }
+ @Override
+ public short getSid() {
+ return (short) _sid;
+ }
- /**
- * These BIFF record types are known but still uninterpreted by POI
- *
- * @return the documented name of this BIFF record type, null if unknown to POI
- */
- public static String getBiffName(int sid) {
- // Note to POI developers:
- // Make sure you delete the corresponding entry from
- // this method any time a new Record subclass is created.
- switch (sid) {
- case PRINTSIZE_0033: return "PRINTSIZE";
- case PLS_004D: return "PLS";
- case 0x0050: return "DCON"; // Data Consolidation Information
- case 0x007F: return "IMDATA";
- case SHEETPR_0081: return "SHEETPR";
- case SORT_0090: return "SORT"; // Sorting Options
- case 0x0094: return "LHRECORD"; // .WK? File Conversion Information
- case STANDARDWIDTH_0099: return "STANDARDWIDTH"; //Standard Column Width
- case SCL_00A0: return "SCL"; // Window Zoom Magnification
- case 0x00AE: return "SCENMAN"; // Scenario Output Data
+ /**
+ * These BIFF record types are known but still uninterpreted by POI
+ *
+ * @return the documented name of this BIFF record type, null if unknown to POI
+ */
+ public static String getBiffName(int sid) {
+ // Note to POI developers:
+ // Make sure you delete the corresponding entry from
+ // this method any time a new Record subclass is created.
+ switch (sid) {
+ case PRINTSIZE_0033: return "PRINTSIZE";
+ case PLS_004D: return "PLS";
+ case 0x0050: return "DCON"; // Data Consolidation Information
+ case 0x007F: return "IMDATA";
+ case SHEETPR_0081: return "SHEETPR";
+ case SORT_0090: return "SORT"; // Sorting Options
+ case 0x0094: return "LHRECORD"; // .WK? File Conversion Information
+ case STANDARDWIDTH_0099: return "STANDARDWIDTH"; //Standard Column Width
+ case SCL_00A0: return "SCL"; // Window Zoom Magnification
+ case 0x00AE: return "SCENMAN"; // Scenario Output Data
- case 0x00B2: return "SXVI"; // (pivot table) View Item
- case 0x00B4: return "SXIVD"; // (pivot table) Row/Column Field IDs
- case 0x00B5: return "SXLI"; // (pivot table) Line Item Array
+ case 0x00B2: return "SXVI"; // (pivot table) View Item
+ case 0x00B4: return "SXIVD"; // (pivot table) Row/Column Field IDs
+ case 0x00B5: return "SXLI"; // (pivot table) Line Item Array
- case 0x00D3: return "OBPROJ";
- case 0x00DC: return "PARAMQRY";
- case 0x00DE: return "OLESIZE";
- case BITMAP_00E9: return "BITMAP";
- case PHONETICPR_00EF: return "PHONETICPR";
- case 0x00F1: return "SXEX"; // PivotTable View Extended Information
+ case 0x00D3: return "OBPROJ";
+ case 0x00DC: return "PARAMQRY";
+ case 0x00DE: return "OLESIZE";
+ case BITMAP_00E9: return "BITMAP";
+ case PHONETICPR_00EF: return "PHONETICPR";
+ case 0x00F1: return "SXEX"; // PivotTable View Extended Information
- case LABELRANGES_015F: return "LABELRANGES";
- case 0x01BA: return "CODENAME";
- case 0x01A9: return "USERBVIEW";
- case 0x01AD: return "QSI";
+ case LABELRANGES_015F: return "LABELRANGES";
+ case 0x01BA: return "CODENAME";
+ case 0x01A9: return "USERBVIEW";
+ case 0x01AD: return "QSI";
- case 0x01C0: return "EXCEL9FILE";
+ case 0x01C0: return "EXCEL9FILE";
- case 0x0802: return "QSISXTAG"; // Pivot Table and Query Table Extensions
- case 0x0803: return "DBQUERYEXT";
- case 0x0805: return "TXTQUERY";
- case 0x0810: return "SXVIEWEX9"; // Pivot Table Extensions
+ case 0x0802: return "QSISXTAG"; // Pivot Table and Query Table Extensions
+ case 0x0803: return "DBQUERYEXT";
+ case 0x0805: return "TXTQUERY";
+ case 0x0810: return "SXVIEWEX9"; // Pivot Table Extensions
- case 0x0812: return "CONTINUEFRT";
- case QUICKTIP_0800: return "QUICKTIP";
- case SHEETEXT_0862: return "SHEETEXT";
- case 0x0863: return "BOOKEXT";
- case 0x0864: return "SXADDL"; // Pivot Table Additional Info
- case SHEETPROTECTION_0867: return "SHEETPROTECTION";
- case 0x086B: return "DATALABEXTCONTENTS";
- case 0x086C: return "CELLWATCH";
- case 0x0874: return "DROPDOWNOBJIDS";
- case 0x0876: return "DCONN";
- case 0x087B: return "CFEX";
- case 0x087C: return "XFCRC";
- case 0x087D: return "XFEXT";
- case 0x087F: return "CONTINUEFRT12";
- case 0x088B: return "PLV";
- case 0x088C: return "COMPAT12";
- case 0x088D: return "DXF";
- case 0x0892: return "STYLEEXT";
- case 0x0896: return "THEME";
- case 0x0897: return "GUIDTYPELIB";
- case 0x089A: return "MTRSETTINGS";
- case 0x089B: return "COMPRESSPICTURES";
- case HEADER_FOOTER_089C: return "HEADERFOOTER";
- case 0x08A1: return "SHAPEPROPSSTREAM";
- case 0x08A3: return "FORCEFULLCALCULATION";
- case 0x08A4: return "SHAPEPROPSSTREAM";
- case 0x08A5: return "TEXTPROPSSTREAM";
- case 0x08A6: return "RICHTEXTSTREAM";
+ case 0x0812: return "CONTINUEFRT";
+ case QUICKTIP_0800: return "QUICKTIP";
+ case SHEETEXT_0862: return "SHEETEXT";
+ case 0x0863: return "BOOKEXT";
+ case 0x0864: return "SXADDL"; // Pivot Table Additional Info
+ case SHEETPROTECTION_0867: return "SHEETPROTECTION";
+ case 0x086B: return "DATALABEXTCONTENTS";
+ case 0x086C: return "CELLWATCH";
+ case 0x0874: return "DROPDOWNOBJIDS";
+ case 0x0876: return "DCONN";
+ case 0x087B: return "CFEX";
+ case 0x087C: return "XFCRC";
+ case 0x087D: return "XFEXT";
+ case 0x087F: return "CONTINUEFRT12";
+ case 0x088B: return "PLV";
+ case 0x088C: return "COMPAT12";
+ case 0x088D: return "DXF";
+ case 0x0892: return "STYLEEXT";
+ case 0x0896: return "THEME";
+ case 0x0897: return "GUIDTYPELIB";
+ case 0x089A: return "MTRSETTINGS";
+ case 0x089B: return "COMPRESSPICTURES";
+ case HEADER_FOOTER_089C: return "HEADERFOOTER";
+ case 0x08A1: return "SHAPEPROPSSTREAM";
+ case 0x08A3: return "FORCEFULLCALCULATION";
+ case 0x08A4: return "SHAPEPROPSSTREAM";
+ case 0x08A5: return "TEXTPROPSSTREAM";
+ case 0x08A6: return "RICHTEXTSTREAM";
- case 0x08C8: return "PLV{Mac Excel}";
+ case 0x08C8: return "PLV{Mac Excel}";
- }
- if (isObservedButUnknown(sid)) {
- return "UNKNOWN-" + Integer.toHexString(sid).toUpperCase();
- }
+ }
+ if (isObservedButUnknown(sid)) {
+ return "UNKNOWN-" + Integer.toHexString(sid).toUpperCase();
+ }
- return null;
- }
+ return null;
+ }
- /**
- * @return true if the unknown record id has been observed in POI unit tests
- */
- private static boolean isObservedButUnknown(int sid) {
- switch (sid) {
- case 0x0033:
- // contains 2 bytes of data: 0x0001 or 0x0003
- case 0x0034:
- // Seems to be written by MSAccess
- // contains text "[Microsoft JET Created Table]0021010"
- // appears after last cell value record and before WINDOW2
- case 0x01BD:
- case 0x01C2:
- // Written by Excel 2007
- // rawData is multiple of 12 bytes long
- // appears after last cell value record and before WINDOW2 or drawing records
- case 0x089D:
- case 0x089E:
- case 0x08A7:
+ /**
+ * @return true if the unknown record id has been observed in POI unit tests
+ */
+ private static boolean isObservedButUnknown(int sid) {
+ switch (sid) {
+ case 0x0033:
+ // contains 2 bytes of data: 0x0001 or 0x0003
+ case 0x0034:
+ // Seems to be written by MSAccess
+ // contains text "[Microsoft JET Created Table]0021010"
+ // appears after last cell value record and before WINDOW2
+ case 0x01BD:
+ case 0x01C2:
+ // Written by Excel 2007
+ // rawData is multiple of 12 bytes long
+ // appears after last cell value record and before WINDOW2 or drawing records
+ case 0x089D:
+ case 0x089E:
+ case 0x08A7:
- case 0x1001:
- case 0x1006:
- case 0x1007:
- case 0x1009:
- case 0x100A:
- case 0x100B:
- case 0x100C:
- case 0x1014:
- case 0x1017:
- case 0x1018:
- case 0x1019:
- case 0x101A:
- case 0x101B:
- case 0x101D:
- case 0x101E:
- case 0x101F:
- case 0x1020:
- case 0x1021:
- case 0x1022:
- case 0x1024:
- case 0x1025:
- case 0x1026:
- case 0x1027:
- case 0x1032:
- case 0x1033:
- case 0x1034:
- case 0x1035:
- case 0x103A:
- case 0x1041:
- case 0x1043:
- case 0x1044:
- case 0x1045:
- case 0x1046:
- case 0x104A:
- case 0x104B:
- case 0x104E:
- case 0x104F:
- case 0x1051:
- case 0x105C:
- case 0x105D:
- case 0x105F:
- case 0x1060:
- case 0x1062:
- case 0x1063:
- case 0x1064:
- case 0x1065:
- case 0x1066:
- return true;
- }
- return false;
- }
+ case 0x1001:
+ case 0x1006:
+ case 0x1007:
+ case 0x1009:
+ case 0x100A:
+ case 0x100B:
+ case 0x100C:
+ case 0x1014:
+ case 0x1017:
+ case 0x1018:
+ case 0x1019:
+ case 0x101A:
+ case 0x101B:
+ case 0x101D:
+ case 0x101E:
+ case 0x101F:
+ case 0x1020:
+ case 0x1021:
+ case 0x1022:
+ case 0x1024:
+ case 0x1025:
+ case 0x1026:
+ case 0x1027:
+ case 0x1032:
+ case 0x1033:
+ case 0x1034:
+ case 0x1035:
+ case 0x103A:
+ case 0x1041:
+ case 0x1043:
+ case 0x1044:
+ case 0x1045:
+ case 0x1046:
+ case 0x104A:
+ case 0x104B:
+ case 0x104E:
+ case 0x104F:
+ case 0x1051:
+ case 0x105C:
+ case 0x105D:
+ case 0x105F:
+ case 0x1060:
+ case 0x1062:
+ case 0x1063:
+ case 0x1064:
+ case 0x1065:
+ case 0x1066:
+ return true;
+ }
+ return false;
+ }
- public Object clone() {
- // immutable - OK to return this
- return this;
- }
+ @Override
+ public Object clone() {
+ // immutable - OK to return this
+ return this;
+ }
}
diff --git a/src/java/org/apache/poi/poifs/dev/POIFSViewEngine.java b/src/java/org/apache/poi/poifs/dev/POIFSViewEngine.java
index e9bb125021..84f2a54632 100644
--- a/src/java/org/apache/poi/poifs/dev/POIFSViewEngine.java
+++ b/src/java/org/apache/poi/poifs/dev/POIFSViewEngine.java
@@ -19,9 +19,12 @@
package org.apache.poi.poifs.dev;
-import java.io.*;
-
-import java.util.*;
+import java.io.IOException;
+import java.io.LineNumberReader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
/**
* This class contains methods used to inspect POIFSViewable objects
@@ -47,12 +50,12 @@ public class POIFSViewEngine
* @return a List of Strings holding the content
*/
- public static List inspectViewable(final Object viewable,
+ public static List inspectViewable(final Object viewable,
final boolean drilldown,
final int indentLevel,
final String indentString)
{
- List objects = new ArrayList();
+ List objects = new ArrayList();
if (viewable instanceof POIFSViewable)
{
@@ -75,7 +78,7 @@ public class POIFSViewEngine
}
else
{
- Iterator iter = inspected.getViewableIterator();
+ Iterator