package org.apache.poi.hssf.eventusermodel.dummyrecord;
import org.apache.poi.hssf.record.Record;
-import org.apache.poi.hssf.record.RecordInputStream;
/**
* A dummy record to indicate that we've now had the last
*/
public int getLastColumnNumber() { return lastColumnNumber; }
- protected void fillFields(RecordInputStream in) {
- }
public short getSid() {
return -1;
}
public int serialize(int offset, byte[] data) {
return -1;
}
- protected void validateSid(short id) {
- }
-
}
package org.apache.poi.hssf.eventusermodel.dummyrecord;
import org.apache.poi.hssf.record.Record;
-import org.apache.poi.hssf.record.RecordInputStream;
/**
* A dummy record for when we're missing a cell in a row,
this.column = column;
}
- protected void fillFields(RecordInputStream in) {
- }
public short getSid() {
return -1;
}
public int serialize(int offset, byte[] data) {
return -1;
}
- protected void validateSid(short id) {
- }
public int getRow() { return row; }
public int getColumn() { return column; }
this.rowNumber = rowNumber;
}
- protected void fillFields(RecordInputStream in) {
- }
public short getSid() {
return -1;
}
public int serialize(int offset, byte[] data) {
return -1;
}
- protected void validateSid(short id) {
- }
public int getRowNumber() {
return rowNumber;
escherRecords = new ArrayList();
}
- /**
- * Constructs a Bar record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
public AbstractEscherHolderRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
escherRecords = new ArrayList();
if (! DESERIALISE )
}
- /**
- * Constructs a AreaFormat record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public AreaFormatRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_foregroundColor = in.readInt();
field_2_backgroundColor = in.readInt();
}
- /**
- * Constructs a Area record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public AreaRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_formatFlags = in.readShort();
}
- /**
- * Constructs a AxisLineFormat record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public AxisLineFormatRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_axisType = in.readShort();
}
}
- /**
- * Constructs a AxisOptions record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public AxisOptionsRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_minimumCategory = in.readShort();
field_2_maximumCategory = in.readShort();
}
- /**
- * Constructs a AxisParent record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public AxisParentRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_axisType = in.readShort();
field_2_x = in.readInt();
}
- /**
- * Constructs a Axis record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public AxisRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_axisType = in.readShort();
field_2_reserved1 = in.readInt();
}
- /**
- * Constructs a AxisUsed record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public AxisUsedRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_numAxis = in.readShort();
}
{
}
- /**
- * Constructs a BOFRecord and sets its fields appropriately
- * @param in the RecordInputstream to read the record from
- */
-
public BOFRecord(RecordInputStream in)
- {
- super(in);
-
- // fillFields(data,size);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_version = in.readShort();
field_2_type = in.readShort();
{
}
- /**
- * Constructs a BackupRecord and sets its fields appropriately
- * @param in the RecordInputstream to read the record from
- */
-
public BackupRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_backup = in.readShort();
}
}
- /**
- * Constructs a Bar record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public BarRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_barSpace = in.readShort();
field_2_categorySpace = in.readShort();
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
*
* @author Glen Stampoultzis (glens at apache.org)
*/
-
-public class BeginRecord
- extends Record
-{
+public class BeginRecord extends Record {
public static final short sid = 0x1033;
public BeginRecord()
}
/**
- * Constructs a BeginRecord record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
+ * @param in unused (since this record has no data)
*/
-
public BeginRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
}
public int serialize(int offset, byte [] data)
{
- LittleEndian.putShort(data, 0 + offset, sid);
- LittleEndian.putShort(data, 2 + offset,
- (( short ) 0)); // no record info
+ LittleEndian.putUShort(data, 0 + offset, sid);
+ LittleEndian.putUShort(data, 2 + offset, 0); // no record info
return getRecordSize();
}
{
}
- /**
- * Constructs a BlankRecord and sets its fields appropriately
- * @param in the RecordInputstream to read the record from
- */
public BlankRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_row = in.readUShort();
field_2_col = in.readShort();
{
}
- /**
- * Constructs a BookBoolRecord and sets its fields appropriately
- * @param in the RecordInputstream to read the record from
- */
-
public BookBoolRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_save_link_values = in.readShort();
}
}
/**
- * Constructs a BoolErr record and sets its fields appropriately.
- *
* @param in the RecordInputstream to read the record from
*/
public BoolErrRecord(RecordInputStream in)
- {
- super(in);
- }
-
- /**
- * @param in the RecordInputstream to read the record from
- */
- protected void fillFields(RecordInputStream in)
{
//field_1_row = LittleEndian.getShort(data, 0 + offset);
field_1_row = in.readUShort();
}
- /**
- * Constructs a BottomMargin record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
public BottomMarginRecord( RecordInputStream in )
- {
- super( in );
- }
-
- protected void fillFields( RecordInputStream in )
{
field_1_margin = in.readDouble();
}
return rec;
}
-} // END OF CLASS
\ No newline at end of file
+} // END OF CLAS
\ No newline at end of file
setSheetname(sheetname);
}
- /**
- * Constructs a BoundSheetRecord and sets its fields appropriately
- *
- * @param in the RecordInputstream to read the record from
- */
- public BoundSheetRecord(RecordInputStream in) {
- super(in);
- }
-
/**
* UTF8: sid + len + bof + flags + len(str) + unicode + str 2 + 2 + 4 + 2 +
* 1 + 1 + len(str)
* 1 + 1 + 2 * len(str)
*
*/
- protected void fillFields(RecordInputStream in) {
+ public BoundSheetRecord(RecordInputStream in) {
field_1_position_of_BOF = in.readInt();
field_2_option_flags = in.readUShort();
int field_3_sheetname_length = in.readUByte();
}
public CFHeaderRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_numcf = in.readShort();
field_2_need_recalculation = in.readShort();
}
public CFRuleRecord(RecordInputStream in) {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in) {
field_1_condition_type = in.readByte();
field_2_comparison_operator = in.readByte();
int field_3_formula1_len = in.readUShort();
throw new RuntimeException("incomplete code");
}
- public CRNCountRecord(RecordInputStream in) {
- super(in);
- }
-
public int getNumberOfCRNs() {
return field_1_number_crn_records;
}
- protected void fillFields(RecordInputStream in) {
+ public CRNCountRecord(RecordInputStream in) {
field_1_number_crn_records = in.readShort();
if(field_1_number_crn_records < 0) {
// TODO - seems like the sign bit of this field might be used for some other purpose
throw new RuntimeException("incomplete code");
}
- public CRNRecord(RecordInputStream in) {
- super(in);
- }
-
public int getNumberOfCRNs() {
return field_1_last_column_index;
}
- protected void fillFields(RecordInputStream in) {
+ public CRNRecord(RecordInputStream in) {
field_1_last_column_index = in.readByte() & 0x00FF;
field_2_first_column_index = in.readByte() & 0x00FF;
field_3_row_index = in.readShort();
{
}
- /**
- * Constructs a CalcCountRecord and sets its fields appropriately
- * @param in the RecordInputstream to read the record from
- *
- */
-
public CalcCountRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_iterations = in.readShort();
}
{
}
- /**
- * Constructs a CalcModeRecord and sets its fields appropriately
- * @param in the RecordInputstream to read the record from
- */
-
public CalcModeRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_calcmode = in.readShort();
}
}
- /**
- * Constructs a CategorySeriesAxis record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public CategorySeriesAxisRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_crossingPoint = in.readShort();
field_2_labelFrequency = in.readShort();
{
}
- /**
- * Constructs a ChartFormatRecord record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public ChartFormatRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field1_x_position = in.readInt();
field2_y_position = in.readInt();
}
- /**
- * Constructs a Chart record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public ChartRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_x = in.readInt();
field_2_y = in.readInt();
}
public ChartTitleFormatRecord(RecordInputStream in) {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in) {
m_recs = in.readUShort();
int idx;
CTFormat ctf;
{
}
- /**
- * Constructs a CodepageRecord and sets its fields appropriately
- * @param in the RecordInputstream to read the record from
- */
-
public CodepageRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_codepage = in.readShort();
}
field_6_reserved = 2; // seems to be the most common value
}
- /**
- * Constructs a ColumnInfo record and sets its fields appropriately
- * @param in the RecordInputstream to read the record from
- */
-
public ColumnInfoRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_first_col = in.readUShort();
field_2_last_col = in.readUShort();
}
- /**
- * Constructs a CommonObjectData record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public CommonObjectDataSubRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_objectType = in.readShort();
field_2_objectId = in.readShort();
{
}
- /**
- * Main constructor -- kinda dummy because we don't validate or fill fields
- *
- * @param in the RecordInputstream to read the record from
- */
-
- public ContinueRecord(RecordInputStream in)
- {
- super(in);
- }
-
/**
* USE ONLY within "processContinue"
*/
* @param in the RecordInputstream to read the record from
*/
- protected void fillFields(RecordInputStream in)
+ public ContinueRecord(RecordInputStream in)
{
field_1_data = in.readRemainder();
}
{
}
- /**
- * Constructs a CountryRecord and sets its fields appropriately
- * @param in the RecordInputstream to read the record from
- */
-
public CountryRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_default_country = in.readShort();
field_2_current_country = in.readShort();
field_2_cell_offsets = new short[0];
}
- /**
- * Constructs a DBCellRecord and sets its fields appropriately
- * @param in the RecordInputstream to read the record from
- */
public DBCellRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_row_offset = in.readUShort();
int size = in.remaining();
{
}
- /**
- * Constructs a DBCellRecord and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public DSFRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_dsf = in.readShort();
}
field_5_dv_no = 0x00000000;
}
- /**
- * Constructs a DVAL record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
- public DVALRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
+ public DVALRecord(RecordInputStream in)
{
this.field_1_options = in.readShort();
this.field_2_horiz_pos = in.readInt();
private static final BitField opt_show_error_on_invalid_value = new BitField(0x00080000);
private static final BitField opt_condition_operator = new BitField(0x00700000);
- /**
- * Constructs a DV record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
- public DVRecord(RecordInputStream in) {
- super(in);
- }
-
public DVRecord(int validationType, int operator, int errorStyle, boolean emptyCellAllowed,
boolean suppressDropDownArrow, boolean isExplicitList,
boolean showPromptBox, String promptTitle, String promptText,
_regions = regions;
}
- protected void fillFields(RecordInputStream in) {
+ public DVRecord(RecordInputStream in) {
_option_flags = in.readInt();
}
- /**
- * Constructs a Dat record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public DatRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_options = in.readShort();
}
}
- /**
- * Constructs a DataFormat record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public DataFormatRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_pointNumber = in.readShort();
field_2_seriesIndex = in.readShort();
{
}
- /**
- * Constructs a DateWindow1904 record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public DateWindow1904Record(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_window = in.readShort();
}
{
}
- /**
- * Constructs a DefaultColumnWidth record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public DefaultColWidthRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_col_width = in.readUShort();
}
}
- /**
- * Constructs a DefaultDataLabelTextProperties record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public DefaultDataLabelTextPropertiesRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_categoryDataType = in.readShort();
}
{
}
- /**
- * Constructs a DefaultRowHeight record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public DefaultRowHeightRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_option_flags = in.readShort();
field_2_row_height = in.readShort();
{
}
- /**
- * Constructs a Delta record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public DeltaRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_max_change = in.readDouble();
}
{
}
- /**
- * Constructs a Dimensions record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public DimensionsRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_first_row = in.readInt();
field_2_last_row = in.readInt();
}
public DrawingRecord( RecordInputStream in )
- {
- super( in );
- }
-
- protected void fillFields( RecordInputStream in )
{
recordData = in.readRemainder();
}
}
/**
- * Constructs a EOFRecord record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
+ * @param in unused (since this record has no data)
*/
-
public EOFRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
}
field_5_ole_classname = "";
}
- /**
- * Constructs an EmbeddedObjectRef record and sets its fields appropriately.
- *
- * @param in the record input stream.
- */
- public EmbeddedObjectRefSubRecord(RecordInputStream in)
- {
- super(in);
- }
-
public short getSid()
{
return sid;
}
- protected void fillFields(RecordInputStream in)
+ public EmbeddedObjectRefSubRecord(RecordInputStream in)
{
field_1_stream_id_offset = in.readShort();
field_2_unknown = in.readShortArray();
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class EndRecord
- extends Record
-{
+public final class EndRecord extends Record {
public static final short sid = 0x1034;
public EndRecord()
}
/**
- * Constructs a EndRecord record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
+ * @param in unused (since this record has no data)
*/
-
public EndRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
}
public int serialize(int offset, byte [] data)
{
- LittleEndian.putShort(data, 0 + offset, sid);
- LittleEndian.putShort(data, 2 + offset,
- (( short ) 0)); // no record info
+ LittleEndian.putUShort(data, 0 + offset, sid);
+ LittleEndian.putUShort(data, 2 + offset, 0); // no record info
return getRecordSize();
}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.LittleEndian;
/**
* The end data record is used to denote the end of the subrecords.
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class EndSubRecord
- extends SubRecord
-{
- public final static short sid = 0x00;
+public final class EndSubRecord extends SubRecord {
+ public final static short sid = 0x00;
public EndSubRecord()
}
/**
- * Constructs a End record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
+ * @param in unused (since this record has no data)
*/
-
public EndSubRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
}
package org.apache.poi.hssf.record;
-import org.apache.poi.ddf.*;
-import org.apache.poi.hssf.usermodel.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.poi.ddf.DefaultEscherRecordFactory;
+import org.apache.poi.ddf.EscherBoolProperty;
+import org.apache.poi.ddf.EscherClientAnchorRecord;
+import org.apache.poi.ddf.EscherClientDataRecord;
+import org.apache.poi.ddf.EscherContainerRecord;
+import org.apache.poi.ddf.EscherDgRecord;
+import org.apache.poi.ddf.EscherDggRecord;
+import org.apache.poi.ddf.EscherOptRecord;
+import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherRecord;
+import org.apache.poi.ddf.EscherRecordFactory;
+import org.apache.poi.ddf.EscherSerializationListener;
+import org.apache.poi.ddf.EscherSpRecord;
+import org.apache.poi.ddf.EscherSpgrRecord;
+import org.apache.poi.ddf.EscherTextboxRecord;
import org.apache.poi.hssf.model.AbstractShape;
-import org.apache.poi.hssf.model.TextboxShape;
-import org.apache.poi.hssf.model.DrawingManager2;
-import org.apache.poi.hssf.model.ConvertAnchor;
import org.apache.poi.hssf.model.CommentShape;
+import org.apache.poi.hssf.model.ConvertAnchor;
+import org.apache.poi.hssf.model.DrawingManager2;
+import org.apache.poi.hssf.model.TextboxShape;
+import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
+import org.apache.poi.hssf.usermodel.HSSFPatriarch;
+import org.apache.poi.hssf.usermodel.HSSFShape;
+import org.apache.poi.hssf.usermodel.HSSFShapeContainer;
+import org.apache.poi.hssf.usermodel.HSSFShapeGroup;
+import org.apache.poi.hssf.usermodel.HSSFTextbox;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
-import java.util.*;
-
/**
* This class is used to aggregate the MSODRAWING and OBJ record
* combinations. This is necessary due to the bizare way in which
return sid;
}
- /**
- * Unused since this is an aggregate record. Use createAggregate().
- *
- * @see #createAggregate
- */
- protected void fillFields( byte[] data, short size, int offset )
- {
- throw new IllegalStateException( "Should not reach here" );
- }
-
/**
* Calculates the string representation of this record. This is
* simply a dump of all the records.
// The top level container ought to have
// the DgRecord and the container of one container
// per shape group (patriach overall first)
- EscherContainerRecord topContainer =
- (EscherContainerRecord)getEscherContainer();
+ EscherContainerRecord topContainer = getEscherContainer();
if(topContainer == null) {
return;
}
}
public ExtSSTInfoSubRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_stream_pos = in.readInt();
field_2_bucket_sst_offset = in.readShort();
field_2_sst_info = new ArrayList();
}
- /**
- * Constructs a EOFRecord record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public ExtSSTRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_2_sst_info = new ArrayList();
field_1_strings_per_bucket = in.readShort();
{
}
- /**
- * Constructs an ExtendedFormat record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public ExtendedFormatRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_font_index = in.readShort();
field_2_format_index = in.readShort();
_list = new ArrayList();
}
- /**
- * Constructs a Extern Sheet record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
- public ExternSheetRecord(RecordInputStream in) {
- super(in);
- }
-
/**
* called by the constructor, should set class level fields. Should throw
* runtime exception for bad/icomplete data.
*
* @param in the RecordInputstream to read the record from
*/
- protected void fillFields(RecordInputStream in) {
+ public ExternSheetRecord(RecordInputStream in) {
_list = new ArrayList();
int nItems = in.readShort();
private short field_2_index;
private short field_3_not_used;
private String field_4_name;
- private Ptg[] field_5_name_definition; // TODO - junits for name definition field
-
- public ExternalNameRecord(RecordInputStream in) {
- super(in);
- }
+ private Ptg[] field_5_name_definition;
/**
* Convenience Function to determine if the name is a built-in name
LittleEndian.putShort( data, 4 + offset, field_1_option_flag );
LittleEndian.putShort( data, 6 + offset, field_2_index );
LittleEndian.putShort( data, 8 + offset, field_3_not_used );
- short nameLen = (short) field_4_name.length();
- LittleEndian.putShort( data, 10 + offset, nameLen );
+ int nameLen = field_4_name.length();
+ LittleEndian.putUShort( data, 10 + offset, nameLen );
StringUtil.putCompressedUnicode( field_4_name, data, 12 + offset );
if(hasFormula()) {
- short defLen = (short) getNameDefinitionSize();
- LittleEndian.putShort( data, 12 + nameLen + offset, defLen );
- Ptg.serializePtgStack(toStack(field_5_name_definition), data, 14 + nameLen + offset );
+ int defLen = getNameDefinitionSize();
+ LittleEndian.putUShort( data, 12 + nameLen + offset, defLen );
+ Ptg.serializePtgs(field_5_name_definition, data, 14 + nameLen + offset );
}
return dataSize + 4;
}
}
- protected void fillFields(RecordInputStream in) {
+ public ExternalNameRecord(RecordInputStream in) {
field_1_option_flag = in.readShort();
field_2_index = in.readShort();
field_3_not_used = in.readShort();
throw readFail("Ran out of record data trying to read formula.");
}
short formulaLen = in.readShort();
- field_5_name_definition = toPtgArray(Ptg.createParsedExpressionTokens(formulaLen, in));
+ field_5_name_definition = Ptg.readTokens(formulaLen, in);
}
/*
* Makes better error messages (while hasFormula() is not reliable)
return true;
}
- private static Ptg[] toPtgArray(Stack s) {
- Ptg[] result = new Ptg[s.size()];
- s.toArray(result);
- return result;
- }
- private static Stack toStack(Ptg[] ptgs) {
- Stack result = new Stack();
- for (int i = 0; i < ptgs.length; i++) {
- result.push(ptgs[i]);
- }
- return result;
- }
-
public short getSid() {
return sid;
}
{
}
- /**
- * Constructs a FILEPASS record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public FilePassRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_encryptedpassword = in.readInt();
private String field_3_username_value;
public FileSharingRecord() {}
-
-
- /**
- * Constructs a FileSharing record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
public FileSharingRecord(RecordInputStream in) {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in) {
field_1_readonly = in.readShort();
field_2_password = in.readShort();
{
}
- /**
- * Constructs a FnGroupCount record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public FnGroupCountRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_count = in.readShort();
}
}
- /**
- * Constructs a FontBasis record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public FontBasisRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_xBasis = in.readShort();
field_2_yBasis = in.readShort();
}
- /**
- * Constructs a FontIndex record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public FontIndexRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_fontIndex = in.readShort();
}
{
}
- /**
- * Constructs a Font record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public FontRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_font_height = in.readShort();
field_2_attributes = in.readShort();
{
}
- /**
- * Constructs a FooterRecord record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public FooterRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
if (in.remaining() > 0)
{
{
}
- /**
- * Constructs a Format record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public FormatRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_index_code = in.readShort();
field_3_unicode_len = in.readShort();
field_8_parsed_expr = Ptg.EMPTY_PTG_ARRAY;
}
- /**
- * Constructs a Formula record and sets its fields appropriately.
- * Note - id must be 0x06 (NOT 0x406 see MSKB #Q184647 for an
- * "explanation of this bug in the documentation) or an exception
- * will be throw upon validation
- *
- * @param in the RecordInputstream to read the record from
- */
-
public FormulaRecord(RecordInputStream in) {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in) {
field_1_row = in.readUShort();
field_2_column = in.readShort();
field_3_xf = in.readShort();
}
- /**
- * Constructs a Frame record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public FrameRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_borderType = in.readShort();
field_2_options = in.readShort();
{
}
- /**
- * Constructs a GridSet record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public GridsetRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_gridset_flag = in.readShort();
}
}
- /**
- * Constructs a group marker record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public GroupMarkerSubRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
// int pos = 0;
reserved = in.readRemainder();
{
}
- /**
- * Constructs a Guts record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public GutsRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_left_row_gutter = in.readShort();
field_2_top_col_gutter = in.readShort();
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
import org.apache.poi.util.LittleEndian;
/**
- * Title: HCenter record<P>
+ * Title: HCenter record (0x0083)<P>
* Description: whether to center between horizontal margins<P>
* REFERENCE: PG 320 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<P>
* @author Andrew C. Oliver (acoliver at apache dot org)
* @author Jason Height (jheight at chariot dot net dot au)
* @version 2.0-pre
*/
-
-public class HCenterRecord
- extends Record
-{
- public final static short sid = 0x83;
+public final class HCenterRecord extends Record {
+ public final static short sid = 0x0083;
private short field_1_hcenter;
public HCenterRecord()
{
}
- /**
- * Constructs an HCenter record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public HCenterRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_hcenter = in.readShort();
}
public int serialize(int offset, byte [] data)
{
LittleEndian.putShort(data, 0 + offset, sid);
- LittleEndian.putShort(data, 2 + offset, ( short ) 0x2);
- LittleEndian.putShort(data, 4 + offset, ( short ) field_1_hcenter);
+ LittleEndian.putUShort(data, 2 + offset, 0x2);
+ LittleEndian.putUShort(data, 4 + offset, field_1_hcenter);
return getRecordSize();
}
{
}
- /**
- * Constructs an Header record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public HeaderRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
if (in.remaining() > 0)
{
{
}
- /**
- * Constructs an HideObj record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public HideObjRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_hide_obj = in.readShort();
}
}
- /**
- * Read hyperlink from input stream
- *
- * @param in the stream to read from
- */
- public HyperlinkRecord(RecordInputStream in)
- {
- super(in);
- }
-
/**
* Return the column of the first cell that contains the hyperlink
*
/**
* @param in the RecordInputstream to read the record from
*/
- protected void fillFields(RecordInputStream in)
+ public HyperlinkRecord(RecordInputStream in)
{
try {
rwFirst = in.readShort();
{
}
- /**
- * Constructs an Index record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public IndexRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_5_dbcells =
new IntList(DBCELL_CAPACITY); // initial capacity of 30
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
import org.apache.poi.util.LittleEndian;
/**
- * Title: Interface End Record<P>
+ * Title: Interface End Record (0x00E2)<P>
* Description: Shows where the Interface Records end (MMS)
* (has no fields)<P>
* REFERENCE: PG 324 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<P>
* @author Andrew C. Oliver (acoliver at apache dot org)
* @version 2.0-pre
*/
-
-public class InterfaceEndRecord
- extends Record
-{
- public final static short sid = 0xe2;
+public final class InterfaceEndRecord extends Record {
+ public final static short sid = 0x00E2;
public InterfaceEndRecord()
{
}
/**
- * Constructs an InterfaceEnd record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
+ * @param in unused (since this record has no data)
*/
-
public InterfaceEndRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
}
{
}
- /**
- * Constructs an Codepage record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public InterfaceHdrRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_codepage = in.readShort();
}
{
}
- /**
- * Constructs an Iteration record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public IterationRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_iteration = in.readShort();
}
}
/**
- * Constructs an Label record and sets its fields appropriately.
- *
* @param in the RecordInputstream to read the record from
*/
public LabelRecord(RecordInputStream in)
- {
- super(in);
- }
-
- /**
- * @param in the RecordInputstream to read the record from
- */
- protected void fillFields(RecordInputStream in)
{
field_1_row = in.readUShort();
field_2_column = in.readShort();
{
}
- /**
- * Constructs an LabelSST record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
public LabelSSTRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_row = in.readUShort();
field_2_column = in.readUShort();
public LeftMarginRecord() { }
- /**
- * Constructs a LeftMargin record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
public LeftMarginRecord(RecordInputStream in)
- { super(in); }
-
- protected void fillFields(RecordInputStream in)
{
field_1_margin = in.readDouble();
}
rec.field_1_margin = this.field_1_margin;
return rec;
}
-} // END OF CLASS
\ No newline at end of file
+} // END OF CLAS
\ No newline at end of file
}
- /**
- * Constructs a Legend record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public LegendRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_xAxisUpperLeft = in.readInt();
field_2_yAxisUpperLeft = in.readInt();
}
- /**
- * Constructs a LineFormat record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public LineFormatRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_lineColor = in.readInt();
field_2_linePattern = in.readShort();
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
*
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class LinkedDataFormulaField
- implements CustomField
-{
+public final class LinkedDataFormulaField implements CustomField {
Stack formulaTokens = new Stack();
public int getSize()
}
- /**
- * Constructs a LinkedData record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public LinkedDataRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_linkType = in.readByte();
field_2_referenceType = in.readByte();
rec.field_2_referenceType = field_2_referenceType;
rec.field_3_options = field_3_options;
rec.field_4_indexNumberFmtRecord = field_4_indexNumberFmtRecord;
- rec.field_5_formulaOfLink = ((LinkedDataFormulaField)field_5_formulaOfLink.clone());;
+ rec.field_5_formulaOfLink = ((LinkedDataFormulaField)field_5_formulaOfLink.clone());
return rec;
}
{
}
- /**
- * Constructs a MMS record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public MMSRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_addMenuCount = in.readByte();
field_2_delMenuCount = in.readByte();
_startIndex = 0;
_regions = cras;
}
- protected void fillFields(RecordInputStream in) {
- throw new RuntimeException("obsolete");
- }
/**
* get the number of merged areas. If this drops down to 0 you should just go
* ahead and delete the record.
{
}
- /**
- * Constructs a MulBlank record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
- public MulBlankRecord(RecordInputStream in)
- {
- super(in);
- }
-
/**
* get the row number of the cells this represents
*
/**
* @param in the RecordInputstream to read the record from
*/
- protected void fillFields(RecordInputStream in)
+ public MulBlankRecord(RecordInputStream in)
{
//field_1_row = LittleEndian.getShort(data, 0 + offset);
field_1_row = in.readUShort();
private RkRec[] field_3_rks;
private short field_4_last_col;
- /**
- * Constructs a MulRK record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
- public MulRKRecord(RecordInputStream in) {
- super(in);
- }
-
public int getRow() {
return field_1_row;
}
/**
* @param in the RecordInputstream to read the record from
*/
- protected void fillFields(RecordInputStream in) {
+ public MulRKRecord(RecordInputStream in) {
field_1_row = in.readUShort();
field_2_first_col = in.readShort();
field_3_rks = RkRec.parseRKs(in);
field_17_status_bar_text = "";
}
- /**
- * Constructs a Name record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
- public NameRecord(RecordInputStream in) {
- super(in);
- }
-
/**
* Constructor to create a built-in named region
* @param builtin Built-in byte representation for the name record, use the public constants
*
* @param in the RecordInputstream to read the record from
*/
- protected void fillFields(RecordInputStream in) {
+ public NameRecord(RecordInputStream in) {
field_1_option_flag = in.readShort();
field_2_keyboard_shortcut = in.readByte();
int field_3_length_name_text = in.readByte();
field_3_flags = 0;
}
- /**
- * Constructs a <code>NoteRecord</code> and fills its fields
- * from the supplied <code>RecordInputStream</code>.
- *
- * @param in the stream to read from
- */
- public NoteRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
/**
* @return id of this record.
*/
/**
* Read the record data from the supplied <code>RecordInputStream</code>
*/
- protected void fillFields(RecordInputStream in)
+ public NoteRecord(RecordInputStream in)
{
field_1_row = in.readShort();
field_2_col = in.readShort();
reserved = new byte[22];
}
- /**
- * Constructs a NoteStructureSubRecord and sets its fields appropriately.
- *
- */
- public NoteStructureSubRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
/**
* Read the record data from the supplied <code>RecordInputStream</code>
*/
- protected void fillFields(RecordInputStream in)
+ public NoteStructureSubRecord(RecordInputStream in)
{
//just grab the raw data
reserved = in.readRemainder();
}
- /**
- * Constructs a NumberFormatIndex record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public NumberFormatIndexRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_formatIndex = in.readShort();
}
}
/**
- * Constructs a Number record and sets its fields appropriately.
- *
* @param in the RecordInputstream to read the record from
*/
public NumberRecord(RecordInputStream in)
- {
- super(in);
- }
-
- /**
- * @param in the RecordInputstream to read the record from
- */
- protected void fillFields(RecordInputStream in)
{
field_1_row = in.readUShort();
field_2_col = in.readUShort();
// TODO - ensure 2 sub-records (ftCmo 15h, and ftEnd 00h) are always created
}
- /**
- * Constructs a OBJ record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public ObjRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
// TODO - problems with OBJ sub-records stream
// MS spec says first sub-records is always CommonObjectDataSubRecord, and last is
}
- /**
- * Constructs a ObjectLink record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public ObjectLinkRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_anchorId = in.readShort();
field_2_link1 = in.readShort();
{
}
- /**
- * Constructs a Protect record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public ObjectProtectRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_protect = in.readShort();
}
_breakMap = new HashMap();
}
- protected PageBreakRecord(RecordInputStream in) {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
+ public PageBreakRecord(RecordInputStream in)
{
int nBreaks = in.readShort();
_breaks = new ArrayList(nBreaks + 2);
createDefaultPalette();
}
- /**
- * Constructs a PaletteRecord record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public PaletteRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_numcolors = in.readShort();
field_2_colors = new ArrayList(field_1_numcolors);
}
- /**
- * Constructs a Pane record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public PaneRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_x = in.readShort();
field_2_y = in.readShort();
public PasswordRecord() {
}
- /**
- * Constructs a Password record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public PasswordRecord(RecordInputStream in) {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in) {
field_1_password = in.readShort();
}
{
}
- /**
- * Constructs a PasswordRev4 (PROT4REVPASS) record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public PasswordRev4Record(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_password = in.readShort();
}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.LittleEndian;
/**
* preceeds and identifies a frame as belonging to the plot area.
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class PlotAreaRecord
- extends Record
-{
+public final class PlotAreaRecord extends Record {
public final static short sid = 0x1035;
}
/**
- * Constructs a PlotArea record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
+ * @param in unused (since this record has no data)
*/
-
public PlotAreaRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
}
}
- /**
- * Constructs a PlotGrowth record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public PlotGrowthRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_horizontalScale = in.readInt();
field_2_verticalScale = in.readInt();
{
}
- /**
- * Constructs a Precision record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public PrecisionRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_precision = in.readShort();
}
{
}
- /**
- * Constructs a PrintGridlines record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public PrintGridlinesRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_print_gridlines = in.readShort();
}
{
}
- /**
- * Constructs a PrintHeaders record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public PrintHeadersRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_print_headers = in.readShort();
}
{
}
- /**
- * Constructs a PrintSetup (SETUP) record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public PrintSetupRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_paper_size = in.readShort();
field_2_scale = in.readShort();
{
}
- /**
- * Constructs a Protect record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public ProtectRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_protect = in.readShort();
}
{
}
- /**
- * Constructs a ProtectionRev4 record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public ProtectionRev4Record(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_protect = in.readShort();
}
{
}
- /**
- * Constructs a RK record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
public RKRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_row = in.readUShort();
field_2_col = in.readUShort();
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
* @see org.apache.poi.hssf.model.Workbook
*/
-public class RecalcIdRecord
- extends Record
-{
+public final class RecalcIdRecord extends Record {
public final static short sid = 0x1c1;
public short[] field_1_recalcids;
{
}
- /**
- * Constructs a RECALCID record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public RecalcIdRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_recalcids = new short[ in.remaining() / 2 ];
for (int k = 0; k < field_1_recalcids.length; k++)
short length = ( short ) (tabids.length * 2);
int byteoffset = 4;
- LittleEndian.putShort(data, 0 + offset, sid);
- LittleEndian.putShort(data, 2 + offset,
- (( short ) length));
+ LittleEndian.putUShort(data, 0 + offset, sid);
+ LittleEndian.putUShort(data, 2 + offset, length);
// 2 (num bytes in a short)
for (int k = 0; k < (length / 2); k++)
{
}
- /**
- * Constructor Record
- *
- * @param in the RecordInputstream to read the record from
- */
- protected Record(RecordInputStream in)
- {
- fillFields(in);
- }
-
- /**
- * called by the constructor, should set class level fields. Should throw
- * runtime exception for bad/icomplete data.
- *
- * @param in the RecordInputstream to read the record from
- */
-
- protected abstract void fillFields(RecordInputStream in);
-
/**
* called by the class that is responsible for writing this sucker.
* Subclasses should implement this so that their data is passed back in a
{
}
- /**
- * Constructs a RefMode record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public RefModeRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_mode = in.readShort();
}
{
}
- /**
- * Constructs a RefreshAll record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public RefreshAllRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_refreshall = in.readShort();
}
public RightMarginRecord() { }
- /**
- * Constructs a RightMargin record and sets its fields appropriately. * * @param id id must be 0x27 or an exception * will be throw upon validation * @param size size the size of the data area of the record * @param data data of the record (should not contain sid/len)
- */
public RightMarginRecord( RecordInputStream in )
- { super( in ); }
-
- protected void fillFields( RecordInputStream in )
{
field_1_margin = in.readDouble();
}
rec.field_1_margin = this.field_1_margin;
return rec;
}
-} // END OF CLAS
\ No newline at end of file
+} // END OF CLA
\ No newline at end of file
field_8_xf_index = ( short ) 0xf;
}
- /**
- * Constructs a Row record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
public RowRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_row_number = in.readUShort();
field_2_first_col = in.readShort();
}
- /**
- * Constructs a SCL record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public SCLRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_numerator = in.readShort();
field_2_denominator = in.readShort();
deserializer = new SSTDeserializer(field_3_strings);
}
- /**
- * Constructs an SST record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
- public SSTRecord( RecordInputStream in )
- {
- super( in );
- }
-
/**
* Add a string.
*
* @param in the RecordInputstream to read the record from
*/
- protected void fillFields( RecordInputStream in )
+ public SSTRecord( RecordInputStream in )
{
// this method is ALWAYS called after construction -- using
// the nontrivial constructor, of course -- so this is where
{
}
- /**
- * Constructs an SaveRecalc record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public SaveRecalcRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_recalc = in.readShort();
}
{
}
- /**
- * Constructs a Protect record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public ScenarioProtectRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_protect = in.readShort();
}
};
}
- /**
- * Constructs a Selection record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
public SelectionRecord(RecordInputStream in) {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in) {
field_1_pane = in.readByte();
field_2_row_active_cell = in.readUShort();
field_3_col_active_cell = in.readShort();
}
- /**
- * Constructs a SeriesChartGroupIndex record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public SeriesChartGroupIndexRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_chartGroupIndex = in.readShort();
}
}
- /**
- * Constructs a SeriesIndex record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public SeriesIndexRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_index = in.readShort();
}
}
- /**
- * Constructs a SeriesLabels record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public SeriesLabelsRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_formatFlags = in.readShort();
}
}
- /**
- * Constructs a SeriesList record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public SeriesListRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_seriesNumbers = in.readShortArray();
}
}
- /**
- * Constructs a Series record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public SeriesRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_categoryDataType = in.readShort();
field_2_valuesDataType = in.readShort();
}
- /**
- * Constructs a SeriesText record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public SeriesTextRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_id = in.readShort();
field_2_textLength = in.readByte();
}
- /**
- * Constructs a SeriesToChartGroup record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public SeriesToChartGroupRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_chartGroupIndex = in.readShort();
}
return dataSize + 4;
}
- protected final void fillFields(RecordInputStream in) {
- throw new RuntimeException("Should not be called. Fields are filled in constructor");
- }
-
/**
* @return <code>true</code> if (rowIx, colIx) is within the range ({@link #getRange()})
* of this shared value object.
}
- /**
- * Constructs a SheetProperties record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public SheetPropertiesRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_flags = in.readShort();
field_2_empty = in.readByte();
{
}
- /**
- * Constructs a String record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
- public StringRecord(RecordInputStream in)
- {
- super(in);
- }
-
/**
* @param in the RecordInputstream to read the record from
*/
- protected void fillFields( RecordInputStream in)
+ public StringRecord( RecordInputStream in)
{
field_1_string_length = in.readShort();
field_2_unicode_flag = in.readByte();
{
}
- /**
- * Constructs a Style record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public StyleRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_xf_index = in.readShort();
if (getType() == STYLE_BUILT_IN)
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
/**
* Subrecords are part of the OBJ class.
*/
-abstract public class SubRecord
- extends Record
-{
- public SubRecord()
- {
- }
-
- public SubRecord( RecordInputStream in )
- {
- super( in );
+abstract public class SubRecord extends Record {
+ protected SubRecord() {
}
public static Record createSubRecord(RecordInputStream in)
_isAddInFunctions = false;
}
- /**
- * Constructs a Extern Sheet record and sets its fields appropriately.
- *
- * @param id id must be 0x16 or an exception will be throw upon validation
- * @param size the size of the data area of the record
- * @param data data of the record (should not contain sid/len)
- */
- public SupBookRecord(RecordInputStream in) {
- super(in);
- }
-
public boolean isExternalReferences() {
return field_3_sheet_names != null;
}
* @param size size of data
* @param offset of the record's data (provided a big array of the file)
*/
- protected void fillFields(RecordInputStream in) {
+ public SupBookRecord(RecordInputStream in) {
field_1_number_of_sheets = in.readShort();
if(in.getLength() > SMALL_RECORD_SIZE) {
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
* @author Andrew C. Oliver (acoliver at apache dot org)
* @version 2.0-pre
*/
-
-public class TabIdRecord
- extends Record
-{
+public final class TabIdRecord extends Record {
public final static short sid = 0x13d;
public short[] field_1_tabids;
{
}
- /**
- * Constructs a TabID record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public TabIdRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_tabids = new short[ in.remaining() / 2 ];
for (int k = 0; k < field_1_tabids.length; k++)
public int serialize(int offset, byte [] data)
{
- short[] tabids = getTabIdArray();
- short length = ( short ) (tabids.length * 2);
- int byteoffset = 4;
+ short[] tabids = getTabIdArray();
+ int length = tabids.length * 2;
+ int byteoffset = 4;
- LittleEndian.putShort(data, 0 + offset, sid);
- LittleEndian.putShort(data, 2 + offset,
- (( short ) length)); // nubmer tabids *
+ LittleEndian.putUShort(data, 0 + offset, sid);
+ LittleEndian.putUShort(data, 2 + offset, length); // nubmer tabids *
// 2 (num bytes in a short)
for (int k = 0; k < (length / 2); k++)
}
- /**
- * Constructs a TextObjectBase record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public TextObjectBaseRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_options = in.readShort();
field_2_textOrientation = in.readShort();
package org.apache.poi.hssf.record;
+import java.io.UnsupportedEncodingException;
+
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
-import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.HexDump;
-import java.io.UnsupportedEncodingException;
-import java.io.ByteArrayOutputStream;
+import org.apache.poi.util.LittleEndian;
public class TextObjectRecord
extends TextObjectBaseRecord
public TextObjectRecord( RecordInputStream in )
{
super( in );
- if (str == null)
- str = new HSSFRichTextString("");
- }
- protected void fillFields(RecordInputStream in)
- {
- super.fillFields(in);
if (getTextLength() > 0) {
if (in.isContinueNext() && in.remaining() == 0) {
//1st Continue
processFontRuns(in);
} else throw new RecordFormatException("Expected Continue Record to hold font runs for TextObjectRecord");
}
+ if (str == null)
+ str = new HSSFRichTextString("");
}
}
- /**
- * Constructs a Text record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public TextRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_horizontalAlignment = in.readByte();
field_2_verticalAlignment = in.readByte();
}
- /**
- * Constructs a Tick record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public TickRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_majorTickType = in.readByte();
public TopMarginRecord() { }
/**
- * Constructs a TopMargin record and sets its fields appropriately.
- *
* @param in the RecordInputstream to read the record from
*/
public TopMarginRecord( RecordInputStream in )
- { super( in ); }
-
- /**
- * @param in the RecordInputstream to read the record from
- */
- protected void fillFields( RecordInputStream in )
{
field_1_margin = in.readDouble();
}
rec.field_1_margin = this.field_1_margin;
return rec;
}
-} // END OF CLASS
\ No newline at end of file
+} // END OF CLAS
\ No newline at end of file
*/
public UncalcedRecord() {
}
- /**
- * read constructor
- */
- public UncalcedRecord(RecordInputStream in) {
- super(in);
- }
public short getSid() {
return sid;
}
- protected void fillFields(RecordInputStream in) {
- short unused = in.readShort();
+ public UncalcedRecord(RecordInputStream in) {
+ in.readShort(); // unused
}
public String toString() {
}
public int serialize(int offset, byte[] data) {
- LittleEndian.putShort(data, 0 + offset, sid);
- LittleEndian.putShort(data, 2 + offset, (short) 2);
- LittleEndian.putShort(data, 4 + offset, (short) 0); // unused
+ LittleEndian.putUShort(data, 0 + offset, sid);
+ LittleEndian.putUShort(data, 2 + offset, 2);
+ LittleEndian.putUShort(data, 4 + offset, 0); // unused
return getRecordSize();
}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
throw new RecordFormatException("Expected continue record.");
}
if (isCompressed) {
- //Typecast direct to char from byte with high bit set causes all ones
- //in the high byte of the char (which is of course incorrect)
- char ch = (char)( (short)0xff & (short)in.readByte() );
+ char ch = (char)in.readUByte(); // avoid sex
tmpString.append(ch);
} else {
char ch = (char) in.readShort();
}
- /**
- * Constructs a Units record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
public UnitsRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_units = in.readShort();
return false;
}
- protected final void fillFields(RecordInputStream in) {
- throw new RecordFormatException(
- "Unknown record cannot be constructed via offset -- we need a copy of the data");
- }
-
public final Object clone() {
// immutable - ok to return this
return this;
{
}
- /**
- * Constructs a UseSelFS record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public UseSelFSRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_flag = in.readShort();
}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
* @version 2.0-pre
*/
-public class VCenterRecord
- extends Record
-{
+public final class VCenterRecord extends Record {
public final static short sid = 0x84;
- private short field_1_vcenter;
+ private int field_1_vcenter;
public VCenterRecord()
{
}
- /**
- * Constructs a VCENTER record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public VCenterRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_vcenter = in.readShort();
}
public void setVCenter(boolean hc)
{
- if (hc == true)
- {
- field_1_vcenter = 1;
- }
- else
- {
- field_1_vcenter = 0;
- }
+ field_1_vcenter = hc ? 1 : 0;
}
/**
public int serialize(int offset, byte [] data)
{
- LittleEndian.putShort(data, 0 + offset, sid);
- LittleEndian.putShort(data, 2 + offset, ( short ) 0x2);
- LittleEndian.putShort(data, 4 + offset, ( short ) field_1_vcenter);
+ LittleEndian.putUShort(data, 0 + offset, sid);
+ LittleEndian.putUShort(data, 2 + offset, 0x2);
+ LittleEndian.putUShort(data, 4 + offset, field_1_vcenter);
return getRecordSize();
}
}
- /**
- * Constructs a ValueRange record and sets its fields appropriately.
- *
- * @param in the RecordInputstream to read the record from
- */
-
public ValueRangeRecord(RecordInputStream in)
- {
- super(in);
-
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_minimumAxisValue = in.readDouble();
field_2_maximumAxisValue = in.readDouble();
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
* @author Jason Height (jheight at chariot dot net dot au)
* @version 2.0-pre
*/
-
-public class WSBoolRecord
- extends Record
-{
+public final class WSBoolRecord extends Record {
public final static short sid = 0x81;
private byte field_1_wsbool; // crappy names are because this is really one big short field (2byte)
- private byte field_2_wsbool; // but the docs inconsistantly use it as 2 seperate bytes
+ private byte field_2_wsbool; // but the docs inconsistently use it as 2 separate bytes
- // I decided to be consistant in this way.
- static final private BitField autobreaks =
- BitFieldFactory.getInstance(0x01); // are automatic page breaks visible
+ // I decided to be consistent in this way.
+ private static final BitField autobreaks = BitFieldFactory.getInstance(0x01); // are automatic page breaks visible
// bits 1 to 3 unused
- static final private BitField dialog =
- BitFieldFactory.getInstance(0x10); // is sheet dialog sheet
- static final private BitField applystyles =
- BitFieldFactory.getInstance(0x20); // whether to apply automatic styles to outlines
- static final private BitField rowsumsbelow = BitFieldFactory.getInstance(
- 0x40); // whether summary rows will appear below detail in outlines
- static final private BitField rowsumsright = BitFieldFactory.getInstance(
- 0x80); // whether summary rows will appear right of the detail in outlines
- static final private BitField fittopage =
- BitFieldFactory.getInstance(0x01); // whether to fit stuff to the page
+ private static final BitField dialog = BitFieldFactory.getInstance(0x10); // is sheet dialog sheet
+ private static final BitField applystyles = BitFieldFactory.getInstance(0x20); // whether to apply automatic styles to outlines
+ private static final BitField rowsumsbelow = BitFieldFactory.getInstance(0x40); // whether summary rows will appear below detail in outlines
+ private static final BitField rowsumsright = BitFieldFactory.getInstance(0x80); // whether summary rows will appear right of the detail in outlines
+ private static final BitField fittopage = BitFieldFactory.getInstance(0x01); // whether to fit stuff to the page
// bit 2 reserved
- static final private BitField displayguts = BitFieldFactory.getInstance(
- 0x06); // whether to display outline symbols (in the gutters)
+ private static final BitField displayguts = BitFieldFactory.getInstance(0x06); // whether to display outline symbols (in the gutters)
// bits 4-5 reserved
- static final private BitField alternateexpression = // whether to use alternate expression eval
- BitFieldFactory.getInstance(0x40);
- static final private BitField alternateformula = // whether to use alternate formula entry
- BitFieldFactory.getInstance(0x80);
+ private static final BitField alternateexpression = BitFieldFactory.getInstance(0x40); // whether to use alternate expression eval
+ private static final BitField alternateformula = BitFieldFactory.getInstance(0x80); // whether to use alternate formula entry
public WSBoolRecord()
{
}
- /**
- * Constructs a WSBool record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public WSBoolRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
byte data[] = in.readRemainder();
field_1_wsbool =
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
* @author Andrew C. Oliver (acoliver at apache dot org)
* @version 2.0-pre
*/
-
-public class WindowOneRecord
- extends Record
-{
+public final class WindowOneRecord extends Record {
public final static short sid = 0x3d;
// our variable names stolen from old TV sets.
{
}
- /**
- * Constructs a WindowOne record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public WindowOneRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_h_hold = in.readShort();
field_2_v_hold = in.readShort();
{
}
- /**
- * Constructs a WindowProtect record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public WindowProtectRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
field_1_protect = in.readShort();
}
{
}
- /**
- * Constructs a WindowTwo record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public WindowTwoRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
int size = in.remaining();
field_1_options = in.readShort();
{
}
- /**
- * Constructs a WriteAccess record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
- */
-
public WriteAccessRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
byte[] data = in.readRemainder();
//The string is always 112 characters (padded with spaces), therefore
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.StringUtil;
/**
* Title: Write Protect Record<P>
* REFERENCE: PG 425 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<P>
* @version 3.0-pre
*/
-
-public class WriteProtectRecord
- extends Record
-{
+public final class WriteProtectRecord extends Record {
public final static short sid = 0x86;
public WriteProtectRecord()
}
/**
- * Constructs a WriteAccess record and sets its fields appropriately.
- * @param in the RecordInputstream to read the record from
+ * @param in unused (since this record has no data)
*/
-
public WriteProtectRecord(RecordInputStream in)
- {
- super(in);
- }
-
- protected void fillFields(RecordInputStream in)
{
}
public int serialize(int offset, byte [] data)
{
- LittleEndian.putShort(data, 0 + offset, sid);
- LittleEndian.putShort(data, 2 + offset, (short)0);
+ LittleEndian.putUShort(data, 0 + offset, sid);
+ LittleEndian.putUShort(data, 2 + offset, 0);
return getRecordSize();
}
public BadlyBehavedRecord() {
//
}
- protected void fillFields(RecordInputStream in) {
- throw new RuntimeException("Should not be called");
- }
public short getSid() {
return 0x777;
}
public int serialize(int offset, byte[] data) {
return 4;
}
- protected void validateSid(short id) {
- throw new RuntimeException("Should not be called");
- }
public int getRecordSize() {
return 8;
}