re-arranging methods getRecordSize and getDataSize in Record / StandardRecord / ContinuableRecord hierarchy
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@723161 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2ebe3f7e32
commit
8be658a251
@ -34,7 +34,7 @@ abstract class DummyRecordBase extends Record {
|
|||||||
public int serialize(int offset, byte[] data) {
|
public int serialize(int offset, byte[] data) {
|
||||||
throw new RecordFormatException("Cannot serialize a dummy record");
|
throw new RecordFormatException("Cannot serialize a dummy record");
|
||||||
}
|
}
|
||||||
protected final int getDataSize() {
|
public final int getRecordSize() {
|
||||||
throw new RecordFormatException("Cannot serialize a dummy record");
|
throw new RecordFormatException("Cannot serialize a dummy record");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,8 @@ public abstract class AbstractEscherHolderRecord extends Record {
|
|||||||
}
|
}
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
protected int getDataSize() {
|
|
||||||
|
public int getRecordSize() {
|
||||||
if (escherRecords.size() == 0 && rawData != null) {
|
if (escherRecords.size() == 0 && rawData != null) {
|
||||||
return rawData.length;
|
return rawData.length;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,9 @@
|
|||||||
|
|
||||||
package org.apache.poi.hssf.record;
|
package org.apache.poi.hssf.record;
|
||||||
|
|
||||||
|
import org.apache.poi.util.HexDump;
|
||||||
import org.apache.poi.util.LittleEndian;
|
import org.apache.poi.util.LittleEndian;
|
||||||
|
import org.apache.poi.util.LittleEndianOutput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Title: Continue Record(0x003C) - Helper class used primarily for SST Records <P>
|
* Title: Continue Record(0x003C) - Helper class used primarily for SST Records <P>
|
||||||
@ -27,7 +29,7 @@ import org.apache.poi.util.LittleEndian;
|
|||||||
* @author Andrew C. Oliver (acoliver at apache dot org)
|
* @author Andrew C. Oliver (acoliver at apache dot org)
|
||||||
* @author Csaba Nagy (ncsaba at yahoo dot com)
|
* @author Csaba Nagy (ncsaba at yahoo dot com)
|
||||||
*/
|
*/
|
||||||
public final class ContinueRecord extends Record {
|
public final class ContinueRecord extends StandardRecord {
|
||||||
public final static short sid = 0x003C;
|
public final static short sid = 0x003C;
|
||||||
private byte[] _data;
|
private byte[] _data;
|
||||||
|
|
||||||
@ -39,70 +41,36 @@ public final class ContinueRecord extends Record {
|
|||||||
return _data.length;
|
return _data.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data) {
|
public void serialize(LittleEndianOutput out) {
|
||||||
return write(data, offset, null, _data);
|
out.write(_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the data for continuation
|
* get the data for continuation
|
||||||
* @return byte array containing all of the continued data
|
* @return byte array containing all of the continued data
|
||||||
*/
|
*/
|
||||||
public byte [] getData()
|
public byte[] getData() {
|
||||||
{
|
|
||||||
return _data;
|
return _data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString()
|
public String toString() {
|
||||||
{
|
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[CONTINUE RECORD]\n");
|
buffer.append("[CONTINUE RECORD]\n");
|
||||||
buffer.append(" .id = ").append(Integer.toHexString(sid))
|
buffer.append(" .data = ").append(HexDump.toHex(_data)).append("\n");
|
||||||
.append("\n");
|
|
||||||
buffer.append("[/CONTINUE RECORD]\n");
|
buffer.append("[/CONTINUE RECORD]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public short getSid()
|
public short getSid() {
|
||||||
{
|
|
||||||
return sid;
|
return sid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public ContinueRecord(RecordInputStream in) {
|
||||||
* Fill the fields. Only thing is, this record has no fields --
|
|
||||||
*
|
|
||||||
* @param in the RecordInputstream to read the record from
|
|
||||||
*/
|
|
||||||
public ContinueRecord(RecordInputStream in)
|
|
||||||
{
|
|
||||||
_data = in.readRemainder();
|
_data = in.readRemainder();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
return new ContinueRecord(_data);
|
return new ContinueRecord(_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes the full encoding of a Continue record without making an instance
|
|
||||||
*/
|
|
||||||
public static int write(byte[] destBuf, int destOffset, Byte initialDataByte, byte[] srcData) {
|
|
||||||
return write(destBuf, destOffset, initialDataByte, srcData, 0, srcData.length);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param initialDataByte (optional - often used for unicode flag).
|
|
||||||
* If supplied, this will be written before srcData
|
|
||||||
* @return the total number of bytes written
|
|
||||||
*/
|
|
||||||
public static int write(byte[] destBuf, int destOffset, Byte initialDataByte, byte[] srcData, int srcOffset, int len) {
|
|
||||||
int totalLen = len + (initialDataByte == null ? 0 : 1);
|
|
||||||
LittleEndian.putUShort(destBuf, destOffset, sid);
|
|
||||||
LittleEndian.putUShort(destBuf, destOffset + 2, totalLen);
|
|
||||||
int pos = destOffset + 4;
|
|
||||||
if (initialDataByte != null) {
|
|
||||||
LittleEndian.putByte(destBuf, pos, initialDataByte.byteValue());
|
|
||||||
pos += 1;
|
|
||||||
}
|
|
||||||
System.arraycopy(srcData, srcOffset, destBuf, pos, len);
|
|
||||||
return 4 + totalLen;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -81,9 +81,10 @@ public final class DrawingGroupRecord extends AbstractEscherHolderRecord {
|
|||||||
public void processChildRecords() {
|
public void processChildRecords() {
|
||||||
convertRawBytesToEscherRecords();
|
convertRawBytesToEscherRecords();
|
||||||
}
|
}
|
||||||
protected int getDataSize() {
|
|
||||||
|
public int getRecordSize() {
|
||||||
// TODO - convert this to a RecordAggregate
|
// TODO - convert this to a RecordAggregate
|
||||||
return grossSizeFromDataSize( getRawDataSize() ) - 4;
|
return grossSizeFromDataSize(getRawDataSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getRawDataSize() {
|
private int getRawDataSize() {
|
||||||
|
@ -69,9 +69,8 @@ import org.apache.poi.util.POILogger;
|
|||||||
*
|
*
|
||||||
* @author Glen Stampoultzis (glens at apache.org)
|
* @author Glen Stampoultzis (glens at apache.org)
|
||||||
*/
|
*/
|
||||||
public class EscherAggregate extends AbstractEscherHolderRecord
|
public final class EscherAggregate extends AbstractEscherHolderRecord {
|
||||||
{
|
public static final short sid = 9876; // not a real sid - dummy value
|
||||||
public static final short sid = 9876;
|
|
||||||
private static POILogger log = POILogFactory.getLogger(EscherAggregate.class);
|
private static POILogger log = POILogFactory.getLogger(EscherAggregate.class);
|
||||||
|
|
||||||
public static final short ST_MIN = (short) 0;
|
public static final short ST_MIN = (short) 0;
|
||||||
@ -498,7 +497,7 @@ public class EscherAggregate extends AbstractEscherHolderRecord
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getDataSize() {
|
public int getRecordSize() {
|
||||||
// TODO - convert this to RecordAggregate
|
// TODO - convert this to RecordAggregate
|
||||||
convertUserModelToRecords();
|
convertUserModelToRecords();
|
||||||
List records = getEscherRecords();
|
List records = getEscherRecords();
|
||||||
@ -516,7 +515,7 @@ public class EscherAggregate extends AbstractEscherHolderRecord
|
|||||||
Record r = (Record) iterator.next();
|
Record r = (Record) iterator.next();
|
||||||
tailRecordSize += r.getRecordSize();
|
tailRecordSize += r.getRecordSize();
|
||||||
}
|
}
|
||||||
return drawingRecordSize + objRecordSize + tailRecordSize - 4;
|
return drawingRecordSize + objRecordSize + tailRecordSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -117,7 +117,7 @@ public final class LabelRecord extends Record implements CellValueRecordInterfac
|
|||||||
public int serialize(int offset, byte [] data) {
|
public int serialize(int offset, byte [] data) {
|
||||||
throw new RecordFormatException("Label Records are supported READ ONLY...convert to LabelSST");
|
throw new RecordFormatException("Label Records are supported READ ONLY...convert to LabelSST");
|
||||||
}
|
}
|
||||||
protected int getDataSize() {
|
public int getRecordSize() {
|
||||||
throw new RecordFormatException("Label Records are supported READ ONLY...convert to LabelSST");
|
throw new RecordFormatException("Label Records are supported READ ONLY...convert to LabelSST");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,9 +119,9 @@ public final class ObjRecord extends Record {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getDataSize() {
|
public int getRecordSize() {
|
||||||
if (_uninterpretedData != null) {
|
if (_uninterpretedData != null) {
|
||||||
return _uninterpretedData.length;
|
return _uninterpretedData.length + 4;
|
||||||
}
|
}
|
||||||
int size = 0;
|
int size = 0;
|
||||||
for (int i=subrecords.size()-1; i>=0; i--) {
|
for (int i=subrecords.size()-1; i>=0; i--) {
|
||||||
@ -137,7 +137,7 @@ public final class ObjRecord extends Record {
|
|||||||
size++;
|
size++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return size;
|
return size + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data) {
|
public int serialize(int offset, byte[] data) {
|
||||||
|
@ -21,22 +21,15 @@ import java.io.ByteArrayInputStream;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Title: Record
|
* Title: Record
|
||||||
* Description: All HSSF Records inherit from this class. It
|
* Description: All HSSF Records inherit from this class.
|
||||||
* populates the fields common to all records (id, size and data).
|
|
||||||
* Subclasses should be sure to validate the id,
|
|
||||||
* Company:
|
|
||||||
* @author Andrew C. Oliver
|
* @author Andrew C. Oliver
|
||||||
* @author Marc Johnson (mjohnson at apache dot org)
|
* @author Marc Johnson (mjohnson at apache dot org)
|
||||||
* @author Jason Height (jheight at chariot dot net dot au)
|
* @author Jason Height (jheight at chariot dot net dot au)
|
||||||
*/
|
*/
|
||||||
public abstract class Record extends RecordBase {
|
public abstract class Record extends RecordBase {
|
||||||
|
|
||||||
/**
|
protected Record() {
|
||||||
* instantiates a blank record strictly for ID matching
|
// no fields to initialise
|
||||||
*/
|
|
||||||
|
|
||||||
protected Record()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,7 +39,6 @@ public abstract class Record extends RecordBase {
|
|||||||
*
|
*
|
||||||
* @return byte array containing instance data
|
* @return byte array containing instance data
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public final byte[] serialize() {
|
public final byte[] serialize() {
|
||||||
byte[] retval = new byte[ getRecordSize() ];
|
byte[] retval = new byte[ getRecordSize() ];
|
||||||
|
|
||||||
@ -54,20 +46,10 @@ public abstract class Record extends RecordBase {
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getRecordSize() {
|
|
||||||
return 4 + getDataSize();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @return the size of the data portion of this record
|
|
||||||
* (does not include initial 4 bytes for sid and size)
|
|
||||||
*/
|
|
||||||
protected abstract int getDataSize();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get a string representation of the record (for biffview/debugging)
|
* get a string representation of the record (for biffview/debugging)
|
||||||
*/
|
*/
|
||||||
public String toString()
|
public String toString() {
|
||||||
{
|
|
||||||
return super.toString();
|
return super.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,26 +60,31 @@ public abstract class Record extends RecordBase {
|
|||||||
public abstract short getSid();
|
public abstract short getSid();
|
||||||
|
|
||||||
public Object clone() {
|
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");
|
throw new RuntimeException("The class "+getClass().getName()+" needs to define a clone method");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clone the current record, via a call to serialise
|
* Clone the current record, via a call to serialize
|
||||||
* it, and another to create a new record from the
|
* it, and another to create a new record from the
|
||||||
* bytes.
|
* bytes.
|
||||||
* May only be used for classes which don't have
|
* May only be used for classes which don't have
|
||||||
* internal counts / ids in them. For those which
|
* internal counts / ids in them. For those which
|
||||||
* do, a full record-aware serialise is needed, which
|
* do, a full model-aware cloning is needed, which
|
||||||
* allocates new ids / counts as needed.
|
* allocates new ids / counts as needed.
|
||||||
*/
|
*/
|
||||||
public Record cloneViaReserialise()
|
public Record cloneViaReserialise() {
|
||||||
{
|
// Do it via a re-serialization
|
||||||
// Do it via a re-serialise
|
|
||||||
// It's a cheat, but it works...
|
// It's a cheat, but it works...
|
||||||
byte[] b = serialize();
|
byte[] b = serialize();
|
||||||
RecordInputStream rinp = new RecordInputStream(
|
RecordInputStream rinp = new RecordInputStream(new ByteArrayInputStream(b));
|
||||||
new ByteArrayInputStream(b)
|
|
||||||
);
|
|
||||||
rinp.nextRecord();
|
rinp.nextRecord();
|
||||||
|
|
||||||
Record[] r = RecordFactory.createRecord(rinp);
|
Record[] r = RecordFactory.createRecord(rinp);
|
||||||
|
@ -27,6 +27,10 @@ import org.apache.poi.util.LittleEndianOutput;
|
|||||||
* @author Josh Micich
|
* @author Josh Micich
|
||||||
*/
|
*/
|
||||||
public abstract class StandardRecord extends Record {
|
public abstract class StandardRecord extends Record {
|
||||||
|
protected abstract int getDataSize();
|
||||||
|
public final int getRecordSize() {
|
||||||
|
return 4 + getDataSize();
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public final int serialize(int offset, byte[] data) {
|
public final int serialize(int offset, byte[] data) {
|
||||||
int dataSize = getDataSize();
|
int dataSize = getDataSize();
|
||||||
|
@ -47,15 +47,15 @@ public abstract class ContinuableRecord extends Record {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return four less than the total length of the encoded record(s)
|
* @return the total length of the encoded record(s)
|
||||||
* (in the case when no {@link ContinueRecord} is needed, this is the
|
* (Note - if any {@link ContinueRecord} is required, this result includes the
|
||||||
* same ushort value that gets encoded after the record sid
|
* size of those too)
|
||||||
*/
|
*/
|
||||||
protected final int getDataSize() {
|
public final int getRecordSize() {
|
||||||
ContinuableRecordOutput out = ContinuableRecordOutput.createForCountingOnly();
|
ContinuableRecordOutput out = ContinuableRecordOutput.createForCountingOnly();
|
||||||
serialize(out);
|
serialize(out);
|
||||||
out.terminate();
|
out.terminate();
|
||||||
return out.getTotalSize() - 4;
|
return out.getTotalSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int serialize(int offset, byte[] data) {
|
public final int serialize(int offset, byte[] data) {
|
||||||
|
@ -30,12 +30,13 @@ import org.apache.poi.hssf.model.HSSFFormulaParser;
|
|||||||
import org.apache.poi.hssf.model.Sheet;
|
import org.apache.poi.hssf.model.Sheet;
|
||||||
import org.apache.poi.hssf.record.NameRecord;
|
import org.apache.poi.hssf.record.NameRecord;
|
||||||
import org.apache.poi.hssf.record.Record;
|
import org.apache.poi.hssf.record.Record;
|
||||||
|
import org.apache.poi.hssf.record.RecordBase;
|
||||||
import org.apache.poi.hssf.record.RecordFormatException;
|
import org.apache.poi.hssf.record.RecordFormatException;
|
||||||
import org.apache.poi.hssf.record.formula.Area3DPtg;
|
import org.apache.poi.hssf.record.formula.Area3DPtg;
|
||||||
import org.apache.poi.util.LittleEndian;
|
import org.apache.poi.util.LittleEndian;
|
||||||
import org.apache.poi.util.TempFile;
|
import org.apache.poi.util.TempFile;
|
||||||
/**
|
/**
|
||||||
*
|
* Tests for {@link HSSFWorkbook}
|
||||||
*/
|
*/
|
||||||
public final class TestHSSFWorkbook extends TestCase {
|
public final class TestHSSFWorkbook extends TestCase {
|
||||||
private static HSSFWorkbook openSample(String sampleFileName) {
|
private static HSSFWorkbook openSample(String sampleFileName) {
|
||||||
@ -75,31 +76,25 @@ public final class TestHSSFWorkbook extends TestCase {
|
|||||||
b.createSheet("Sheet1");
|
b.createSheet("Sheet1");
|
||||||
b.createSheet();
|
b.createSheet();
|
||||||
b.createSheet("name1");
|
b.createSheet("name1");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
b.createSheet("name1");
|
b.createSheet("name1");
|
||||||
fail();
|
fail();
|
||||||
}
|
} catch (IllegalArgumentException pass) {
|
||||||
catch ( IllegalArgumentException pass )
|
// expected during successful test
|
||||||
{
|
|
||||||
}
|
}
|
||||||
b.createSheet();
|
b.createSheet();
|
||||||
try
|
try {
|
||||||
{
|
b.setSheetName(3, "name1");
|
||||||
b.setSheetName( 3, "name1" );
|
|
||||||
fail();
|
fail();
|
||||||
}
|
} catch (IllegalArgumentException pass) {
|
||||||
catch ( IllegalArgumentException pass )
|
// expected during successful test
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try {
|
||||||
{
|
b.setSheetName(3, "name1");
|
||||||
b.setSheetName( 3, "name1" );
|
|
||||||
fail();
|
fail();
|
||||||
}
|
} catch (IllegalArgumentException pass) {
|
||||||
catch ( IllegalArgumentException pass )
|
// expected during successful test
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
b.setSheetName( 3, "name2" );
|
b.setSheetName( 3, "name2" );
|
||||||
@ -393,7 +388,7 @@ public final class TestHSSFWorkbook extends TestCase {
|
|||||||
public void testSheetSerializeSizeMismatch_bug45066() {
|
public void testSheetSerializeSizeMismatch_bug45066() {
|
||||||
HSSFWorkbook wb = new HSSFWorkbook();
|
HSSFWorkbook wb = new HSSFWorkbook();
|
||||||
Sheet sheet = wb.createSheet("Sheet1").getSheet();
|
Sheet sheet = wb.createSheet("Sheet1").getSheet();
|
||||||
List sheetRecords = sheet.getRecords();
|
List<RecordBase> sheetRecords = sheet.getRecords();
|
||||||
// one way (of many) to cause the discrepancy is with a badly behaved record:
|
// one way (of many) to cause the discrepancy is with a badly behaved record:
|
||||||
sheetRecords.add(new BadlyBehavedRecord());
|
sheetRecords.add(new BadlyBehavedRecord());
|
||||||
// There is also much logic inside Sheet that (if buggy) might also cause the discrepancy
|
// There is also much logic inside Sheet that (if buggy) might also cause the discrepancy
|
||||||
@ -410,7 +405,7 @@ public final class TestHSSFWorkbook extends TestCase {
|
|||||||
* Checks that us and HSSFName play nicely with named ranges
|
* Checks that us and HSSFName play nicely with named ranges
|
||||||
* that point to deleted sheets
|
* that point to deleted sheets
|
||||||
*/
|
*/
|
||||||
public void testNamesToDeleteSheets() throws Exception {
|
public void testNamesToDeleteSheets() {
|
||||||
HSSFWorkbook b = openSample("30978-deleted.xls");
|
HSSFWorkbook b = openSample("30978-deleted.xls");
|
||||||
assertEquals(3, b.getNumberOfNames());
|
assertEquals(3, b.getNumberOfNames());
|
||||||
|
|
||||||
@ -442,7 +437,7 @@ public final class TestHSSFWorkbook extends TestCase {
|
|||||||
n = b.getNameAt(0);
|
n = b.getNameAt(0);
|
||||||
assertEquals("On2", n.getNameName());
|
assertEquals("On2", n.getNameName());
|
||||||
assertEquals("", n.getSheetName());
|
assertEquals("", n.getSheetName());
|
||||||
assertEquals("#REF!$A$1:$A$3", n.getReference());
|
assertEquals("#REF!$A$1:$A$3", n.getRefersToFormula());
|
||||||
|
|
||||||
|
|
||||||
/* ======= Name pointing to 1st sheet ====== */
|
/* ======= Name pointing to 1st sheet ====== */
|
||||||
@ -465,7 +460,7 @@ public final class TestHSSFWorkbook extends TestCase {
|
|||||||
n = b.getNameAt(1);
|
n = b.getNameAt(1);
|
||||||
assertEquals("OnOne", n.getNameName());
|
assertEquals("OnOne", n.getNameName());
|
||||||
assertEquals("Sheet1", n.getSheetName());
|
assertEquals("Sheet1", n.getSheetName());
|
||||||
assertEquals("Sheet1!$A$3:$A$4", n.getReference());
|
assertEquals("Sheet1!$A$3:$A$4", n.getRefersToFormula());
|
||||||
|
|
||||||
|
|
||||||
/* ======= Name pointing to 3rd sheet ====== */
|
/* ======= Name pointing to 3rd sheet ====== */
|
||||||
@ -488,7 +483,7 @@ public final class TestHSSFWorkbook extends TestCase {
|
|||||||
n = b.getNameAt(2);
|
n = b.getNameAt(2);
|
||||||
assertEquals("OnSheet3", n.getNameName());
|
assertEquals("OnSheet3", n.getNameName());
|
||||||
assertEquals("Sheet3", n.getSheetName());
|
assertEquals("Sheet3", n.getSheetName());
|
||||||
assertEquals("Sheet3!$A$1:$A$2", n.getReference());
|
assertEquals("Sheet3!$A$1:$A$2", n.getRefersToFormula());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -504,8 +499,8 @@ public final class TestHSSFWorkbook extends TestCase {
|
|||||||
public int serialize(int offset, byte[] data) {
|
public int serialize(int offset, byte[] data) {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
protected int getDataSize() {
|
public int getRecordSize() {
|
||||||
return 4;
|
return 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user