/** Creates new CFHeaderRecord */
public CFHeaderRecord() {
+ field_3_enclosing_cell_range = new CellRangeAddress(0, 0, 0, 0);
field_4_cell_ranges = new CellRangeAddressList();
}
public CFHeaderRecord(CellRangeAddress[] regions, int nRules) {
CFHeaderRecord result = new CFHeaderRecord();
result.field_1_numcf = field_1_numcf;
result.field_2_need_recalculation_and_id = field_2_need_recalculation_and_id;
- result.field_3_enclosing_cell_range = field_3_enclosing_cell_range;
+ result.field_3_enclosing_cell_range = field_3_enclosing_cell_range.copy();
result.field_4_cell_ranges = field_4_cell_ranges.copy();
return result;
}
package org.apache.poi.hssf.record.common;
import org.apache.poi.hssf.record.RecordInputStream;
+import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.util.LittleEndianOutput;
/**
private short recordType;
/** This is a FrtFlags */
private short grbitFrt;
- /** MUST be 8 bytes and all zero TODO Correct this! */
- private byte[] reserved;
+ /** The range of cells the parent record applies to, or 0 if N/A */
+ private CellRangeAddress associatedRange;
public FtrHeader() {
- reserved = new byte[8];
+ associatedRange = new CellRangeAddress(0, 0, 0, 0);
}
public FtrHeader(RecordInputStream in) {
recordType = in.readShort();
grbitFrt = in.readShort();
- reserved = new byte[8];
- in.read(reserved, 0, 8);
+ associatedRange = new CellRangeAddress(in);
}
public String toString() {
public void serialize(LittleEndianOutput out) {
out.writeShort(recordType);
out.writeShort(grbitFrt);
- out.write(reserved);
+ associatedRange.serialize(out);
}
public static int getDataSize() {
this.grbitFrt = grbitFrt;
}
- public byte[] getReserved() {
- return reserved;
+ public CellRangeAddress getAssociatedRange() {
+ return associatedRange;
}
- public void setReserved(byte[] reserved) {
- this.reserved = reserved;
+ public void setAssociatedRange(CellRangeAddress associatedRange) {
+ this.associatedRange = associatedRange;
}
public Object clone() {
FtrHeader result = new FtrHeader();
result.recordType = recordType;
result.grbitFrt = grbitFrt;
- result.reserved = reserved;
+ result.associatedRange = associatedRange.copy();
return result;
}
}
\ No newline at end of file