Introduced Record.getDataSize() method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@709264 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0fff7ab2d2
commit
3b262ac93e
@ -156,7 +156,7 @@ public final class BoundSheetRecord extends Record {
|
|||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getDataSize() {
|
protected int getDataSize() {
|
||||||
return 8 + field_5_sheetname.length() * (isMultibyte() ? 2 : 1);
|
return 8 + field_5_sheetname.length() * (isMultibyte() ? 2 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ public final class CFHeaderRecord extends Record {
|
|||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getDataSize() {
|
protected int getDataSize() {
|
||||||
return 4 // 2 short fields
|
return 4 // 2 short fields
|
||||||
+ CellRangeAddress.ENCODED_SIZE
|
+ CellRangeAddress.ENCODED_SIZE
|
||||||
+ field_4_cell_ranges.getSize();
|
+ field_4_cell_ranges.getSize();
|
||||||
|
@ -63,7 +63,7 @@ public final class CRNRecord extends Record {
|
|||||||
sb.append("]");
|
sb.append("]");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
private int getDataSize() {
|
protected int getDataSize() {
|
||||||
return 4 + ConstantValueParser.getEncodedSize(field_4_constant_values);
|
return 4 + ConstantValueParser.getEncodedSize(field_4_constant_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,8 +153,7 @@ public class ExternSheetRecord extends Record {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected int getDataSize() {
|
||||||
private int getDataSize() {
|
|
||||||
return 2 + _list.size() * RefSubRecord.ENCODED_SIZE;
|
return 2 + _list.size() * RefSubRecord.ENCODED_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public final class ExternalNameRecord extends Record {
|
|||||||
return field_4_name;
|
return field_4_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getDataSize(){
|
protected int getDataSize(){
|
||||||
int result = 3 * 2 // 3 short fields
|
int result = 3 * 2 // 3 short fields
|
||||||
+ 2 + field_4_name.length(); // nameLen and name
|
+ 2 + field_4_name.length(); // nameLen and name
|
||||||
if(hasFormula()) {
|
if(hasFormula()) {
|
||||||
|
@ -353,7 +353,7 @@ public final class FormulaRecord extends Record implements CellValueRecordInterf
|
|||||||
return sid;
|
return sid;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getDataSize() {
|
protected int getDataSize() {
|
||||||
return FIXED_SIZE + field_8_parsed_expr.getEncodedSize();
|
return FIXED_SIZE + field_8_parsed_expr.getEncodedSize();
|
||||||
}
|
}
|
||||||
public int serialize(int offset, byte [] data) {
|
public int serialize(int offset, byte [] data) {
|
||||||
|
@ -119,7 +119,7 @@ public final class ObjRecord extends Record {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getDataSize() {
|
protected int getDataSize() {
|
||||||
if (_uninterpretedData != null) {
|
if (_uninterpretedData != null) {
|
||||||
return _uninterpretedData.length;
|
return _uninterpretedData.length;
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ public abstract class PageBreakRecord extends Record {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getDataSize() {
|
protected int getDataSize() {
|
||||||
return 2 + _breaks.size() * Break.ENCODED_SIZE;
|
return 2 + _breaks.size() * Break.ENCODED_SIZE;
|
||||||
}
|
}
|
||||||
public int getRecordSize() {
|
public int getRecordSize() {
|
||||||
|
@ -54,6 +54,15 @@ public abstract class Record extends RecordBase {
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the size of the data portion of this record
|
||||||
|
* (does not include initial 4 bytes for sid and size)
|
||||||
|
*/
|
||||||
|
protected int getDataSize() {
|
||||||
|
// implementation is currently a hack
|
||||||
|
// will eventually swap this out
|
||||||
|
return getRecordSize() - 4;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* get a string representation of the record (for biffview/debugging)
|
* get a string representation of the record (for biffview/debugging)
|
||||||
*/
|
*/
|
||||||
|
@ -143,7 +143,7 @@ public final class SelectionRecord extends Record {
|
|||||||
buffer.append("[/SELECTION]\n");
|
buffer.append("[/SELECTION]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
private int getDataSize() {
|
protected int getDataSize() {
|
||||||
return 9 // 1 byte + 4 shorts
|
return 9 // 1 byte + 4 shorts
|
||||||
+ CellRangeAddress8Bit.getEncodedSize(field_6_refs.length);
|
+ CellRangeAddress8Bit.getEncodedSize(field_6_refs.length);
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ public final class StyleRecord extends Record {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private int getDataSize() {
|
protected int getDataSize() {
|
||||||
if (isBuiltin()) {
|
if (isBuiltin()) {
|
||||||
return 4; // short, byte, byte
|
return 4; // short, byte, byte
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ public final class SupBookRecord extends Record {
|
|||||||
sb.append("]");
|
sb.append("]");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
private int getDataSize() {
|
protected int getDataSize() {
|
||||||
if(!isExternalReferences()) {
|
if(!isExternalReferences()) {
|
||||||
return SMALL_RECORD_SIZE;
|
return SMALL_RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ public final class TextObjectRecord extends Record {
|
|||||||
* Only for the current record. does not include any subsequent Continue
|
* Only for the current record. does not include any subsequent Continue
|
||||||
* records
|
* records
|
||||||
*/
|
*/
|
||||||
private int getDataSize() {
|
protected int getDataSize() {
|
||||||
int result = 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4;
|
int result = 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4;
|
||||||
if (_linkRefPtg != null) {
|
if (_linkRefPtg != null) {
|
||||||
result += 2 // formula size
|
result += 2 // formula size
|
||||||
|
Loading…
Reference in New Issue
Block a user