Merged revisions 701756,702231 via svnmerge from

https://svn.apache.org/repos/asf/poi/trunk

........
  r701756 | josh | 2008-10-05 00:22:12 -0700 (Sun, 05 Oct 2008) | 1 line
  
  Fixing comments and formatting inside Record subclasses
........
  r702231 | josh | 2008-10-06 12:13:41 -0700 (Mon, 06 Oct 2008) | 1 line
  
  Fix for 43354 - made the formula evaluator capable of handling missing function arguments
........


git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@703070 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Josh Micich 2008-10-09 06:46:17 +00:00
parent 7e158d23a5
commit 52c6f5aa0c
62 changed files with 325 additions and 696 deletions

View File

@ -67,6 +67,7 @@
<action dev="POI-DEVELOPERS" type="add">Created a common interface for handling Excel files, irrespective of if they are .xls or .xlsx</action> <action dev="POI-DEVELOPERS" type="add">Created a common interface for handling Excel files, irrespective of if they are .xls or .xlsx</action>
</release> </release>
<release version="3.2-alpha1" date="2008-??-??"> <release version="3.2-alpha1" date="2008-??-??">
<action dev="POI-DEVELOPERS" type="fix">43354 - support for evalating formulas with missing args</action>
<action dev="POI-DEVELOPERS" type="fix">45912 - fixed ArrayIndexOutOfBoundsException in EmbeddedObjectRefSubRecord</action> <action dev="POI-DEVELOPERS" type="fix">45912 - fixed ArrayIndexOutOfBoundsException in EmbeddedObjectRefSubRecord</action>
<action dev="POI-DEVELOPERS" type="fix">45889 - fixed ArrayIndexOutOfBoundsException when constructing HSLF Table with a single row </action> <action dev="POI-DEVELOPERS" type="fix">45889 - fixed ArrayIndexOutOfBoundsException when constructing HSLF Table with a single row </action>
<action dev="POI-DEVELOPERS" type="add">Initial support for creating hyperlinks in HSLF</action> <action dev="POI-DEVELOPERS" type="add">Initial support for creating hyperlinks in HSLF</action>

View File

@ -64,6 +64,7 @@
<action dev="POI-DEVELOPERS" type="add">Created a common interface for handling Excel files, irrespective of if they are .xls or .xlsx</action> <action dev="POI-DEVELOPERS" type="add">Created a common interface for handling Excel files, irrespective of if they are .xls or .xlsx</action>
</release> </release>
<release version="3.2-alpha1" date="2008-??-??"> <release version="3.2-alpha1" date="2008-??-??">
<action dev="POI-DEVELOPERS" type="fix">43354 - support for evalating formulas with missing args</action>
<action dev="POI-DEVELOPERS" type="fix">45912 - fixed ArrayIndexOutOfBoundsException in EmbeddedObjectRefSubRecord</action> <action dev="POI-DEVELOPERS" type="fix">45912 - fixed ArrayIndexOutOfBoundsException in EmbeddedObjectRefSubRecord</action>
<action dev="POI-DEVELOPERS" type="fix">45889 - fixed ArrayIndexOutOfBoundsException when constructing HSLF Table with a single row </action> <action dev="POI-DEVELOPERS" type="fix">45889 - fixed ArrayIndexOutOfBoundsException when constructing HSLF Table with a single row </action>
<action dev="POI-DEVELOPERS" type="add">Initial support for creating hyperlinks in HSLF</action> <action dev="POI-DEVELOPERS" type="add">Initial support for creating hyperlinks in HSLF</action>

View File

@ -36,9 +36,7 @@ import org.apache.poi.util.LittleEndian;
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
* @author Michael Zalewski (zalewski at optonline.net) * @author Michael Zalewski (zalewski at optonline.net)
*/ */
public abstract class AbstractEscherHolderRecord public abstract class AbstractEscherHolderRecord extends Record {
extends Record
{
private static boolean DESERIALISE; private static boolean DESERIALISE;
static { static {
try { try {
@ -133,34 +131,6 @@ public abstract class AbstractEscherHolderRecord
return getRecordSize(); return getRecordSize();
} }
// public int serialize(int offset, byte[] data)
// {
// if (escherRecords.size() == 0 && rawData != null)
// {
// System.arraycopy( rawData, 0, data, offset, rawData.length);
// return rawData.length;
// }
// else
// {
// collapseShapeInformation();
//
// LittleEndian.putShort(data, 0 + offset, getSid());
// LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
//
// int pos = offset + 4;
// for ( Iterator iterator = escherRecords.iterator(); iterator.hasNext(); )
// {
// EscherRecord r = (EscherRecord) iterator.next();
// pos += r.serialize(pos, data, new NullEscherSerializationListener() );
// }
//
// return getRecordSize();
// }
// }
/**
* Size of record (including 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
if (escherRecords.size() == 0 && rawData != null) if (escherRecords.size() == 0 && rawData != null)
@ -323,9 +293,4 @@ public abstract class AbstractEscherHolderRecord
{ {
convertToEscherRecords(0, rawData.length, rawData ); convertToEscherRecords(0, rawData.length, rawData );
} }
}
} // END OF CLASS

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The area format record is used to define the colours and patterns for an area. * The area format record is used to define the colours and patterns for an area.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class AreaFormatRecord extends Record { public final class AreaFormatRecord extends Record {
@ -112,9 +110,6 @@ public final class AreaFormatRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 4 + 4 + 2 + 2 + 2 + 2; return 4 + 4 + 4 + 2 + 2 + 2 + 2;

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The area record is used to define a area chart. * The area record is used to define a area chart.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class AreaRecord extends Record { public final class AreaRecord extends Record {
@ -77,9 +75,6 @@ public final class AreaRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2; return 4 + 2;

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The axis line format record defines the axis type details. * The axis line format record defines the axis type details.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class AxisLineFormatRecord public final class AxisLineFormatRecord extends Record {
extends Record
{
public final static short sid = 0x1021; public final static short sid = 0x1021;
private short field_1_axisType; private short field_1_axisType;
public final static short AXIS_TYPE_AXIS_LINE = 0; public final static short AXIS_TYPE_AXIS_LINE = 0;
@ -77,9 +70,6 @@ public class AxisLineFormatRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2; return 4 + 2;
@ -128,10 +118,4 @@ public class AxisLineFormatRecord
{ {
this.field_1_axisType = field_1_axisType; this.field_1_axisType = field_1_axisType;
} }
}
} // END OF CLASS

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The axis options record provides unit information and other various tidbits about the axis. * The axis options record provides unit information and other various tidbits about the axis.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Andrew C. Oliver(acoliver at apache.org) * @author Andrew C. Oliver(acoliver at apache.org)
*/ */
public final class AxisOptionsRecord extends Record { public final class AxisOptionsRecord extends Record {
@ -144,9 +142,6 @@ public final class AxisOptionsRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2; return 4 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2;

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The axis size and location * The axis size and location<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class AxisParentRecord public final class AxisParentRecord extends Record {
extends Record
{
public final static short sid = 0x1041; public final static short sid = 0x1041;
private short field_1_axisType; private short field_1_axisType;
public final static short AXIS_TYPE_MAIN = 0; public final static short AXIS_TYPE_MAIN = 0;
@ -103,9 +96,6 @@ public class AxisParentRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 4 + 4 + 4 + 4; return 4 + 2 + 4 + 4 + 4 + 4;
@ -218,10 +208,4 @@ public class AxisParentRecord
{ {
this.field_5_height = field_5_height; this.field_5_height = field_5_height;
} }
}
} // END OF CLASS

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The axis record defines the type of an axis. * The axis record defines the type of an axis.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class AxisRecord public final class AxisRecord extends Record {
extends Record
{
public final static short sid = 0x101d; public final static short sid = 0x101d;
private short field_1_axisType; private short field_1_axisType;
public final static short AXIS_TYPE_CATEGORY_OR_X_AXIS = 0; public final static short AXIS_TYPE_CATEGORY_OR_X_AXIS = 0;
@ -104,9 +97,6 @@ public class AxisRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 4 + 4 + 4 + 4; return 4 + 2 + 4 + 4 + 4 + 4;
@ -221,10 +211,4 @@ public class AxisRecord
{ {
this.field_5_reserved4 = field_5_reserved4; this.field_5_reserved4 = field_5_reserved4;
} }
}
} // END OF CLASS

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The number of axes used on a chart. * The number of axes used on a chart.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class AxisUsedRecord public final class AxisUsedRecord extends Record {
extends Record
{
public final static short sid = 0x1046; public final static short sid = 0x1046;
private short field_1_numAxis; private short field_1_numAxis;
@ -73,9 +66,6 @@ public class AxisUsedRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2; return 4 + 2;
@ -111,10 +101,4 @@ public class AxisUsedRecord
{ {
this.field_1_numAxis = field_1_numAxis; this.field_1_numAxis = field_1_numAxis;
} }
}
} // END OF CLASS

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The bar record is used to define a bar chart. * The bar record is used to define a bar chart.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class BarRecord extends Record { public final class BarRecord extends Record {
@ -94,9 +92,6 @@ public final class BarRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 2 + 2; return 4 + 2 + 2 + 2;

View File

@ -23,14 +23,11 @@ import org.apache.poi.util.*;
/** /**
* Record for the bottom margin. * Record for the bottom margin.<p/>
* NOTE: This source was automatically generated.
* *
* @author Shawn Laubach (slaubach at apache dot org) * @author Shawn Laubach (slaubach at apache dot org)
*/ */
public class BottomMarginRecord public final class BottomMarginRecord extends Record implements Margin {
extends Record implements Margin
{
public final static short sid = 0x29; public final static short sid = 0x29;
private double field_1_margin; private double field_1_margin;
@ -62,9 +59,6 @@ public class BottomMarginRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 8; return 4 + 8;
@ -98,4 +92,4 @@ public class BottomMarginRecord
return rec; return rec;
} }
} // END OF CLAS } // END OF CLA

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* This record refers to a category or series axis and is used to specify label/tickmark frequency. * This record refers to a category or series axis and is used to specify label/tickmark frequency.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class CategorySeriesAxisRecord extends Record { public final class CategorySeriesAxisRecord extends Record {
@ -99,9 +97,6 @@ public final class CategorySeriesAxisRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 2 + 2 + 2; return 4 + 2 + 2 + 2 + 2;

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,16 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The chart record is used to define the location and size of a chart. * The chart record is used to define the location and size of a chart.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class ChartRecord public final class ChartRecord extends Record {
extends Record
{
public final static short sid = 0x1002; public final static short sid = 0x1002;
private int field_1_x; private int field_1_x;
private int field_2_y; private int field_2_y;
@ -94,9 +86,6 @@ public class ChartRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 4 + 4 + 4 + 4; return 4 + 4 + 4 + 4 + 4;
@ -183,10 +172,4 @@ public class ChartRecord
{ {
this.field_4_height = field_4_height; this.field_4_height = field_4_height;
} }
}
} // END OF CLASS

View File

@ -23,9 +23,7 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The common object data record is used to store all common preferences for an excel object. * The common object data record is used to store all common preferences for an excel object.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* remove the record in src/records/definitions.
* *
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
@ -147,9 +145,6 @@ public final class CommonObjectDataSubRecord extends SubRecord {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 2 + 2 + 4 + 4 + 4; return 4 + 2 + 2 + 2 + 4 + 4 + 4;

View File

@ -164,7 +164,6 @@ public class DVALRecord extends Record
return getRecordSize(); return getRecordSize();
} }
//with 4 bytes header
public int getRecordSize() public int getRecordSize()
{ {
return 22; return 22;

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The dat record is used to store options for the chart. * The dat record is used to store options for the chart.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class DatRecord extends Record { public final class DatRecord extends Record {
@ -80,9 +78,6 @@ public final class DatRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2; return 4 + 2;

View File

@ -23,9 +23,7 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The data format record is used to index into a series. * The data format record is used to index into a series.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* remove the record in src/records/definitions.
* *
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
@ -95,9 +93,6 @@ public final class DataFormatRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 2 + 2 + 2; return 4 + 2 + 2 + 2 + 2;

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The default data label text properties record identifies the text characteristics of the preceeding text record. * The default data label text properties record identifies the text characteristics of the preceding text record.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class DefaultDataLabelTextPropertiesRecord public final class DefaultDataLabelTextPropertiesRecord extends Record {
extends Record
{
public final static short sid = 0x1024; public final static short sid = 0x1024;
private short field_1_categoryDataType; private short field_1_categoryDataType;
public final static short CATEGORY_DATA_TYPE_SHOW_LABELS_CHARACTERISTIC = 0; public final static short CATEGORY_DATA_TYPE_SHOW_LABELS_CHARACTERISTIC = 0;
@ -76,9 +69,6 @@ public class DefaultDataLabelTextPropertiesRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2; return 4 + 2;
@ -125,10 +115,4 @@ public class DefaultDataLabelTextPropertiesRecord
{ {
this.field_1_categoryDataType = field_1_categoryDataType; this.field_1_categoryDataType = field_1_categoryDataType;
} }
}
} // END OF CLASS

View File

@ -83,9 +83,6 @@ public class DrawingGroupRecord extends AbstractEscherHolderRecord
convertRawBytesToEscherRecords(); convertRawBytesToEscherRecords();
} }
/**
* Size of record (including 4 byte headers for all sections)
*/
public int getRecordSize() public int getRecordSize()
{ {
return grossSizeFromDataSize( getRawDataSize() ); return grossSizeFromDataSize( getRawDataSize() );

View File

@ -20,10 +20,8 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The end data record is used to denote the end of the subrecords. * The end data record is used to denote the end of the subrecords.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class EndSubRecord extends SubRecord { public final class EndSubRecord extends SubRecord {
@ -61,9 +59,6 @@ public final class EndSubRecord extends SubRecord {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 ; return 4 ;
@ -79,9 +74,4 @@ public final class EndSubRecord extends SubRecord {
return rec; return rec;
} }
}
} // END OF CLASS

View File

@ -498,9 +498,6 @@ public class EscherAggregate extends AbstractEscherHolderRecord
return size; return size;
} }
/**
* The number of bytes required to serialize this record.
*/
public int getRecordSize() public int getRecordSize()
{ {
convertUserModelToRecords(); convertUserModelToRecords();

View File

@ -129,7 +129,6 @@ public class ExtSSTRecord
return pos; return pos;
} }
/** Returns the size of this record */
public int getRecordSize() public int getRecordSize()
{ {
return 6 + 8*getNumInfoRecords(); return 6 + 8*getNumInfoRecords();

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The font basis record stores various font metrics. * The font basis record stores various font metrics.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class FontBasisRecord public final class FontBasisRecord extends Record {
extends Record
{
public final static short sid = 0x1060; public final static short sid = 0x1060;
private short field_1_xBasis; private short field_1_xBasis;
private short field_2_yBasis; private short field_2_yBasis;
@ -101,9 +94,6 @@ public class FontBasisRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 2 + 2 + 2 + 2; return 4 + 2 + 2 + 2 + 2 + 2;
@ -207,10 +197,4 @@ public class FontBasisRecord
{ {
this.field_5_indexToFontTable = field_5_indexToFontTable; this.field_5_indexToFontTable = field_5_indexToFontTable;
} }
}
} // END OF CLASS

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The font index record indexes into the font table for the text record. * The font index record indexes into the font table for the text record.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class FontIndexRecord public final class FontIndexRecord extends Record {
extends Record
{
public final static short sid = 0x1026; public final static short sid = 0x1026;
private short field_1_fontIndex; private short field_1_fontIndex;
@ -73,9 +66,6 @@ public class FontIndexRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2; return 4 + 2;
@ -111,10 +101,4 @@ public class FontIndexRecord
{ {
this.field_1_fontIndex = field_1_fontIndex; this.field_1_fontIndex = field_1_fontIndex;
} }
}
} // END OF CLASS

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The frame record indicates whether there is a border around the displayed text of a chart. * The frame record indicates whether there is a border around the displayed text of a chart.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class FrameRecord extends Record { public final class FrameRecord extends Record {
@ -85,9 +83,6 @@ public final class FrameRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 2; return 4 + 2 + 2;

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,18 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The group marker record is used as a position holder for groups. * The group marker record is used as a position holder for groups.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class GroupMarkerSubRecord public class GroupMarkerSubRecord extends SubRecord {
extends SubRecord public final static short sid = 0x0006;
{
public final static short sid = 0x06;
private byte[] reserved = new byte[0]; // would really love to know what goes in here. private byte[] reserved = new byte[0]; // would really love to know what goes in here.
@ -43,7 +37,6 @@ public class GroupMarkerSubRecord
public GroupMarkerSubRecord(RecordInputStream in) public GroupMarkerSubRecord(RecordInputStream in)
{ {
// int pos = 0;
reserved = in.readRemainder(); reserved = in.readRemainder();
} }
@ -67,9 +60,6 @@ public class GroupMarkerSubRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + reserved.length; return 4 + reserved.length;
@ -87,9 +77,4 @@ public class GroupMarkerSubRecord
rec.reserved[i] = reserved[i]; rec.reserved[i] = reserved[i];
return rec; return rec;
} }
}
} // END OF CLASS

View File

@ -17,16 +17,16 @@
package org.apache.poi.hssf.record; package org.apache.poi.hssf.record;
import org.apache.poi.util.*; import org.apache.poi.util.LittleEndian;
/** /**
* Record for the left margin. * Record for the left margin.<p/>
* NOTE: This source was automatically generated. *
* @author Shawn Laubach (slaubach at apache dot org) * @author Shawn Laubach (slaubach at apache dot org)
*/ */
public class LeftMarginRecord extends Record implements Margin public class LeftMarginRecord extends Record implements Margin
{ {
public final static short sid = 0x26; public final static short sid = 0x0026;
private double field_1_margin; private double field_1_margin;
public LeftMarginRecord() { } public LeftMarginRecord() { }
@ -53,9 +53,6 @@ public class LeftMarginRecord extends Record implements Margin
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() { public int getRecordSize() {
return 4 + 8; return 4 + 8;
} }
@ -85,4 +82,4 @@ public class LeftMarginRecord extends Record implements Margin
rec.field_1_margin = this.field_1_margin; rec.field_1_margin = this.field_1_margin;
return rec; return rec;
} }
} // END OF CLAS } // END OF CLA

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* Defines a legend for a chart. * Defines a legend for a chart.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Andrew C. Oliver (acoliver at apache.org) * @author Andrew C. Oliver (acoliver at apache.org)
*/ */
public final class LegendRecord extends Record { public final class LegendRecord extends Record {
@ -135,9 +133,6 @@ public final class LegendRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 4 + 4 + 4 + 4 + 1 + 1 + 2; return 4 + 4 + 4 + 4 + 4 + 1 + 1 + 2;

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* Describes a line format record. The line format record controls how a line on a chart appears. * Describes a line format record. The line format record controls how a line on a chart appears.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class LineFormatRecord extends Record { public final class LineFormatRecord extends Record {
@ -120,9 +118,6 @@ public final class LineFormatRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 4 + 2 + 2 + 2 + 2; return 4 + 4 + 2 + 2 + 2 + 2;

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* Describes a linked data record. This record referes to the series data or text. * Describes a linked data record. This record referes to the series data or text.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class LinkedDataRecord extends Record { public final class LinkedDataRecord extends Record {
@ -110,9 +108,6 @@ public final class LinkedDataRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 1 + 1 + 2 + 2 + field_5_formulaOfLink.getSize(); return 4 + 1 + 1 + 2 + 2 + field_5_formulaOfLink.getSize();

View File

@ -20,19 +20,18 @@ package org.apache.poi.hssf.record;
/** /**
* The margin interface is a parent used to define left, right, top and bottom margins. * The margin interface is a parent used to define left, right, top and bottom margins.
* This allows much of the code to be generic when it comes to handling margins. * This allows much of the code to be generic when it comes to handling margins.
* NOTE: This source wass automatically generated.
* *
* @author Shawn Laubach (slaubach at apache dot org) * @author Shawn Laubach (slaubach at apache dot org)
*/ */
public interface Margin public interface Margin {
{ // TODO - introduce MarginBaseRecord
/** /**
* Get the margin field for the Margin. * Get the margin field for the Margin.
*/ */
public double getMargin(); public double getMargin();
/** /**
* Set the margin field for the Margin. * Set the margin field for the Margin.
*/ */
public void setMargin( double field_1_margin ); public void setMargin(double field_1_margin);
} // END OF CLASS }

View File

@ -410,8 +410,6 @@ public final class NameRecord extends Record {
return nChars; return nChars;
} }
/** returns the record size
*/
public int getRecordSize(){ public int getRecordSize(){
return 4 // sid + size return 4 // sid + size
+ 15 // 4 shorts + 7 bytes + 15 // 4 shorts + 7 bytes

View File

@ -100,9 +100,6 @@ public class NoteRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record
*/
public int getRecordSize() public int getRecordSize()
{ {
int retval = 4 + 2 + 2 + 2 + 2 + 2 + 1 + field_5_author.length() + 1; int retval = 4 + 2 + 2 + 2 + 2 + 2 + 1 + field_5_author.length() + 1;

View File

@ -87,9 +87,6 @@ public class NoteStructureSubRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + reserved.length; return 4 + reserved.length;

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,24 +15,18 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The number format index record indexes format table. This applies to an axis. * The number format index record indexes format table. This applies to an axis.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class NumberFormatIndexRecord public final class NumberFormatIndexRecord extends Record {
extends Record public final static short sid = 0x104E;
{
public final static short sid = 0x104e;
private short field_1_formatIndex; private short field_1_formatIndex;
@ -73,9 +66,6 @@ public class NumberFormatIndexRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2; return 4 + 2;
@ -111,10 +101,4 @@ public class NumberFormatIndexRecord
{ {
this.field_1_formatIndex = field_1_formatIndex; this.field_1_formatIndex = field_1_formatIndex;
} }
}
} // END OF CLASS

View File

@ -117,9 +117,6 @@ public final class ObjRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (excluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
int size = 0; int size = 0;

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* Links text to an object on the chart or identifies it as the title. * Links text to an object on the chart or identifies it as the title.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Andrew C. Oliver (acoliver at apache.org) * @author Andrew C. Oliver (acoliver at apache.org)
*/ */
public class ObjectLinkRecord public final class ObjectLinkRecord extends Record {
extends Record
{
public final static short sid = 0x1027; public final static short sid = 0x1027;
private short field_1_anchorId; private short field_1_anchorId;
public final static short ANCHOR_ID_CHART_TITLE = 1; public final static short ANCHOR_ID_CHART_TITLE = 1;
@ -93,9 +86,6 @@ public class ObjectLinkRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 2 + 2; return 4 + 2 + 2 + 2;
@ -180,10 +170,4 @@ public class ObjectLinkRecord
{ {
this.field_3_link2 = field_3_link2; this.field_3_link2 = field_3_link2;
} }
}
} // END OF CLASS

View File

@ -22,10 +22,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* Describes the frozen and unfozen panes. * Describes the frozen and unfozen panes.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class PaneRecord extends Record { public final class PaneRecord extends Record {
@ -104,9 +102,6 @@ public final class PaneRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 2 + 2 + 2 + 2; return 4 + 2 + 2 + 2 + 2 + 2;

View File

@ -20,10 +20,8 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* preceeds and identifies a frame as belonging to the plot area. * preceeds and identifies a frame as belonging to the plot area.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Andrew C. Oliver (acoliver at apache.org) * @author Andrew C. Oliver (acoliver at apache.org)
*/ */
public final class PlotAreaRecord extends Record { public final class PlotAreaRecord extends Record {
@ -62,9 +60,6 @@ public final class PlotAreaRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 ; return 4 ;
@ -80,13 +75,4 @@ public final class PlotAreaRecord extends Record {
return rec; return rec;
} }
}
} // END OF CLASS

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The plot growth record specifies the scaling factors used when a font is scaled. * The plot growth record specifies the scaling factors used when a font is scaled.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class PlotGrowthRecord public final class PlotGrowthRecord extends Record {
extends Record
{
public final static short sid = 0x1064; public final static short sid = 0x1064;
private int field_1_horizontalScale; private int field_1_horizontalScale;
private int field_2_verticalScale; private int field_2_verticalScale;
@ -81,9 +74,6 @@ public class PlotGrowthRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 4 + 4; return 4 + 4 + 4;
@ -136,10 +126,4 @@ public class PlotGrowthRecord
{ {
this.field_2_verticalScale = field_2_verticalScale; this.field_2_verticalScale = field_2_verticalScale;
} }
}
} // END OF CLASS

View File

@ -15,16 +15,16 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
package org.apache.poi.hssf.record; package org.apache.poi.hssf.record;
import org.apache.poi.util.*; import org.apache.poi.util.LittleEndian;
/** /**
* Record for the right margin. * NOTE: This source was automatically generated. * @author Shawn Laubach (slaubach at apache dot org) * Record for the right margin.<p/>
*
* @author Shawn Laubach (slaubach at apache dot org)
*/ */
public class RightMarginRecord extends Record implements Margin public final class RightMarginRecord extends Record implements Margin {
{
public final static short sid = 0x27; public final static short sid = 0x27;
private double field_1_margin; private double field_1_margin;
@ -52,9 +52,6 @@ public class RightMarginRecord extends Record implements Margin
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() { return 4 + 8; } public int getRecordSize() { return 4 + 8; }
public short getSid() { return sid; } public short getSid() { return sid; }
@ -76,4 +73,4 @@ public class RightMarginRecord extends Record implements Margin
rec.field_1_margin = this.field_1_margin; rec.field_1_margin = this.field_1_margin;
return rec; return rec;
} }
} // END OF CLA } // END OF CL

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,24 +15,19 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* Specifies the window's zoom magnification. If this record isn't present then the windows zoom is 100%. see p384 Excel Dev Kit * Specifies the window's zoom magnification. <p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or * If this record isn't present then the windows zoom is 100%. see p384 Excel Dev Kit
* remove the record in src/records/definitions. *
* @author Andrew C. Oliver (acoliver at apache.org) * @author Andrew C. Oliver (acoliver at apache.org)
*/ */
public class SCLRecord public final class SCLRecord extends Record {
extends Record public final static short sid = 0x00A0;
{
public final static short sid = 0xa0;
private short field_1_numerator; private short field_1_numerator;
private short field_2_denominator; private short field_2_denominator;
@ -80,9 +74,6 @@ public class SCLRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 2; return 4 + 2 + 2;
@ -135,10 +126,4 @@ public class SCLRecord
{ {
this.field_2_denominator = field_2_denominator; this.field_2_denominator = field_2_denominator;
} }
}
} // END OF CLASS

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The series chart group index record stores the index to the CHARTFORMAT record (0 based). * The series chart group index record stores the index to the CHARTFORMAT record (0 based).<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class SeriesChartGroupIndexRecord public final class SeriesChartGroupIndexRecord extends Record {
extends Record
{
public final static short sid = 0x1045; public final static short sid = 0x1045;
private short field_1_chartGroupIndex; private short field_1_chartGroupIndex;
@ -73,9 +66,6 @@ public class SeriesChartGroupIndexRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2; return 4 + 2;
@ -111,10 +101,4 @@ public class SeriesChartGroupIndexRecord
{ {
this.field_1_chartGroupIndex = field_1_chartGroupIndex; this.field_1_chartGroupIndex = field_1_chartGroupIndex;
} }
}
} // END OF CLASS

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* links a series to its position in the series list. * links a series to its position in the series list.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Andrew C. Oliver (acoliver at apache.org) * @author Andrew C. Oliver (acoliver at apache.org)
*/ */
public class SeriesIndexRecord public final class SeriesIndexRecord extends Record {
extends Record
{
public final static short sid = 0x1065; public final static short sid = 0x1065;
private short field_1_index; private short field_1_index;
@ -73,9 +66,6 @@ public class SeriesIndexRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2; return 4 + 2;
@ -111,10 +101,4 @@ public class SeriesIndexRecord
{ {
this.field_1_index = field_1_index; this.field_1_index = field_1_index;
} }
}
} // END OF CLASS

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The series label record defines the type of label associated with the data format record. * The series label record defines the type of label associated with the data format record.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class SeriesLabelsRecord extends Record { public final class SeriesLabelsRecord extends Record {
@ -83,9 +81,6 @@ public final class SeriesLabelsRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2; return 4 + 2;

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The series record describes the overall data for a series. * The series record describes the overall data for a series.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class SeriesRecord public final class SeriesRecord extends Record {
extends Record
{
public final static short sid = 0x1003; public final static short sid = 0x1003;
private short field_1_categoryDataType; private short field_1_categoryDataType;
public final static short CATEGORY_DATA_TYPE_DATES = 0; public final static short CATEGORY_DATA_TYPE_DATES = 0;
@ -121,9 +114,6 @@ public class SeriesRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 2 + 2 + 2 + 2 + 2; return 4 + 2 + 2 + 2 + 2 + 2 + 2;
@ -283,10 +273,4 @@ public class SeriesRecord
{ {
this.field_6_numBubbleValues = field_6_numBubbleValues; this.field_6_numBubbleValues = field_6_numBubbleValues;
} }
}
} // END OF CLASS

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,18 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*; import org.apache.poi.util.StringUtil;
/** /**
* Defines a series name * Defines a series name</p>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Andrew C. Oliver (acoliver at apache.org) * @author Andrew C. Oliver (acoliver at apache.org)
*/ */
public class SeriesTextRecord public final class SeriesTextRecord extends Record {
extends Record
{
public final static short sid = 0x100d; public final static short sid = 0x100d;
private short field_1_id; private short field_1_id;
private byte field_2_textLength; private byte field_2_textLength;
@ -94,9 +88,6 @@ public class SeriesTextRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 1 + 1 + (field_2_textLength *2); return 4 + 2 + 1 + 1 + (field_2_textLength *2);
@ -199,10 +190,4 @@ public class SeriesTextRecord
{ {
this.field_4_text = field_4_text; this.field_4_text = field_4_text;
} }
}
} // END OF CLASS

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,19 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* Indicates the chart-group index for a series. The order probably defines the mapping. So the 0th record probably means the 0th series. The only field in this of course defines which chart group the 0th series (for instance) would map to. Confusing? Well thats because it is. (p 522 BCG) * Indicates the chart-group index for a series. The order probably defines the mapping.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or * So the 0th record probably means the 0th series. The only field in this of course defines which chart
* remove the record in src/records/definitions. * group the 0th series (for instance) would map to. Confusing? Well thats because it is. (p 522 BCG)<p/>
*
* @author Andrew C. Oliver (acoliver at apache.org) * @author Andrew C. Oliver (acoliver at apache.org)
*/ */
public class SeriesToChartGroupRecord public final class SeriesToChartGroupRecord extends Record {
extends Record
{
public final static short sid = 0x1045; public final static short sid = 0x1045;
private short field_1_chartGroupIndex; private short field_1_chartGroupIndex;
@ -73,9 +68,6 @@ public class SeriesToChartGroupRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2; return 4 + 2;
@ -111,10 +103,4 @@ public class SeriesToChartGroupRecord
{ {
this.field_1_chartGroupIndex = field_1_chartGroupIndex; this.field_1_chartGroupIndex = field_1_chartGroupIndex;
} }
}
} // END OF CLASS

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* Describes a chart sheet properties record. * Describes a chart sheet properties record.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class SheetPropertiesRecord extends Record { public final class SheetPropertiesRecord extends Record {
@ -92,9 +90,6 @@ public final class SheetPropertiesRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 1; return 4 + 2 + 1;

View File

@ -68,9 +68,6 @@ public class StringRecord extends Record {
return isUnCompressedUnicode() ? field_1_string_length * 2 : field_1_string_length; return isUnCompressedUnicode() ? field_1_string_length * 2 : field_1_string_length;
} }
/**
* gives the current serialized size of the record. Should include the sid and reclength (4 bytes).
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 1 + getStringByteLength(); return 4 + 2 + 1 + getStringByteLength();

View File

@ -19,21 +19,21 @@
package org.apache.poi.hssf.record; package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.BitFieldFactory;
import org.apache.poi.util.*; import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian;
/** /**
* The TXO record is used to define the properties of a text box. It is followed * The TXO record is used to define the properties of a text box. It is followed
by two continue records unless there is no actual text. The first continue record contains * by two continue records unless there is no actual text. The first continue record contains
the text data and the next continue record contains the formatting runs. * the text data and the next continue record contains the formatting runs.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class TextObjectBaseRecord extends Record { public class TextObjectBaseRecord extends Record {
public final static short sid = 0x1B6; // TODO - don't instantiate superclass
public final static short sid = 0x01B6;
private static final BitField reserved1 = BitFieldFactory.getInstance(0x0001); private static final BitField reserved1 = BitFieldFactory.getInstance(0x0001);
private static final BitField HorizontalTextAlignment = BitFieldFactory.getInstance(0x000E); private static final BitField HorizontalTextAlignment = BitFieldFactory.getInstance(0x000E);
@ -149,9 +149,6 @@ public class TextObjectBaseRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4; return 4 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4;

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The text record is used to define text stored on a chart. * The text record is used to define text stored on a chart.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class TextRecord extends Record { public final class TextRecord extends Record {
@ -204,9 +202,6 @@ public final class TextRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 1 + 1 + 2 + 4 + 4 + 4 + 4 + 4 + 2 + 2 + 2 + 2; return 4 + 1 + 1 + 2 + 4 + 4 + 4 + 4 + 4 + 2 + 2 + 2 + 2;

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The Tick record defines how tick marks and label positioning/formatting * The Tick record defines how tick marks and label positioning/formatting<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Andrew C. Oliver(acoliver at apache.org) * @author Andrew C. Oliver(acoliver at apache.org)
*/ */
public final class TickRecord extends Record { public final class TickRecord extends Record {
@ -151,9 +149,6 @@ public final class TickRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 1 + 1 + 1 + 1 + 4 + 8 + 8 + 2 + 2 + 2; return 4 + 1 + 1 + 1 + 1 + 4 + 8 + 8 + 2 + 2 + 2;

View File

@ -20,13 +20,11 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.*; import org.apache.poi.util.*;
/** /**
* Record for the top margin. * Record for the top margin.<p/>
* NOTE: This source was automatically generated.
* *
* @author Shawn Laubach (slaubach at apache dot org) * @author Shawn Laubach (slaubach at apache dot org)
*/ */
public class TopMarginRecord extends Record implements Margin public final class TopMarginRecord extends Record implements Margin {
{
public final static short sid = 0x28; public final static short sid = 0x28;
private double field_1_margin; private double field_1_margin;
@ -57,9 +55,6 @@ public class TopMarginRecord extends Record implements Margin
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() { return 4 + 8; } public int getRecordSize() { return 4 + 8; }
public short getSid() { return sid; } public short getSid() { return sid; }
@ -81,4 +76,4 @@ public class TopMarginRecord extends Record implements Margin
rec.field_1_margin = this.field_1_margin; rec.field_1_margin = this.field_1_margin;
return rec; return rec;
} }
} // END OF CLAS } // END OF CLA

View File

@ -1,4 +1,3 @@
/* ==================================================================== /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
@ -16,23 +15,17 @@
limitations under the License. limitations under the License.
==================================================================== */ ==================================================================== */
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.*;
/** /**
* The units record describes units. * The units record describes units.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public class UnitsRecord public final class UnitsRecord extends Record {
extends Record
{
public final static short sid = 0x1001; public final static short sid = 0x1001;
private short field_1_units; private short field_1_units;
@ -74,9 +67,6 @@ public class UnitsRecord
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 2; return 4 + 2;
@ -112,10 +102,4 @@ public class UnitsRecord
{ {
this.field_1_units = field_1_units; this.field_1_units = field_1_units;
} }
}
} // END OF CLASS

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
/** /**
* The value range record defines the range of the value axis. * The value range record defines the range of the value axis.<p/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or *
* remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org) * @author Glen Stampoultzis (glens at apache.org)
*/ */
public final class ValueRangeRecord extends Record { public final class ValueRangeRecord extends Record {
@ -121,9 +119,6 @@ public final class ValueRangeRecord extends Record {
return getRecordSize(); return getRecordSize();
} }
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() public int getRecordSize()
{ {
return 4 + 8 + 8 + 8 + 8 + 8 + 2; return 4 + 8 + 8 + 8 + 8 + 8 + 2;

View File

@ -0,0 +1,35 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.hssf.record.formula.eval;
/**
* Represents the (intermediate) evaluated result of a missing function argument. In most cases
* this can be translated into {@link BlankEval} but there are some notable exceptions. Functions
* COUNT and COUNTA <em>do</em> count their missing args. Note - the differences between
* {@link MissingArgEval} and {@link BlankEval} have not been investigated fully, so the POI
* evaluator may need to be updated to account for these as they are found.
*
* @author Josh Micich
*/
public final class MissingArgEval implements ValueEval {
public static MissingArgEval instance = new MissingArgEval();
private MissingArgEval() {
}
}

View File

@ -19,6 +19,7 @@ package org.apache.poi.hssf.record.formula.functions;
import org.apache.poi.hssf.record.formula.eval.ErrorEval; import org.apache.poi.hssf.record.formula.eval.ErrorEval;
import org.apache.poi.hssf.record.formula.eval.Eval; import org.apache.poi.hssf.record.formula.eval.Eval;
import org.apache.poi.hssf.record.formula.eval.MissingArgEval;
import org.apache.poi.hssf.record.formula.eval.NumberEval; import org.apache.poi.hssf.record.formula.eval.NumberEval;
import org.apache.poi.hssf.record.formula.functions.CountUtils.I_MatchPredicate; import org.apache.poi.hssf.record.formula.functions.CountUtils.I_MatchPredicate;
@ -64,6 +65,10 @@ public final class Count implements Function {
// only numbers are counted // only numbers are counted
return true; return true;
} }
if(valueEval == MissingArgEval.instance) {
// oh yeah, and missing arguments
return true;
}
// error values and string values not counted // error values and string values not counted
return false; return false;

View File

@ -52,6 +52,7 @@ import org.apache.poi.hssf.record.formula.eval.BoolEval;
import org.apache.poi.hssf.record.formula.eval.ErrorEval; import org.apache.poi.hssf.record.formula.eval.ErrorEval;
import org.apache.poi.hssf.record.formula.eval.Eval; import org.apache.poi.hssf.record.formula.eval.Eval;
import org.apache.poi.hssf.record.formula.eval.FunctionEval; import org.apache.poi.hssf.record.formula.eval.FunctionEval;
import org.apache.poi.hssf.record.formula.eval.MissingArgEval;
import org.apache.poi.hssf.record.formula.eval.NameEval; import org.apache.poi.hssf.record.formula.eval.NameEval;
import org.apache.poi.hssf.record.formula.eval.NameXEval; import org.apache.poi.hssf.record.formula.eval.NameXEval;
import org.apache.poi.hssf.record.formula.eval.NumberEval; import org.apache.poi.hssf.record.formula.eval.NumberEval;
@ -284,10 +285,7 @@ public final class WorkbookEvaluator {
continue; continue;
} }
if (ptg instanceof MemErrPtg) { continue; } if (ptg instanceof MemErrPtg) { continue; }
if (ptg instanceof MissingArgPtg) {
// TODO - might need to push BlankEval or MissingArgEval
continue;
}
Eval opResult; Eval opResult;
if (ptg instanceof OperationPtg) { if (ptg instanceof OperationPtg) {
OperationPtg optg = (OperationPtg) ptg; OperationPtg optg = (OperationPtg) ptg;
@ -306,6 +304,9 @@ public final class WorkbookEvaluator {
} }
// logDebug("invoke " + operation + " (nAgs=" + numops + ")"); // logDebug("invoke " + operation + " (nAgs=" + numops + ")");
opResult = invokeOperation(operation, ops, _workbook, sheetIndex, srcRowNum, srcColNum); opResult = invokeOperation(operation, ops, _workbook, sheetIndex, srcRowNum, srcColNum);
if (opResult == MissingArgEval.instance) {
opResult = BlankEval.INSTANCE;
}
} else { } else {
opResult = getEvalForPtg(ptg, sheetIndex, tracker); opResult = getEvalForPtg(ptg, sheetIndex, tracker);
} }
@ -424,6 +425,9 @@ public final class WorkbookEvaluator {
if (ptg instanceof ErrPtg) { if (ptg instanceof ErrPtg) {
return ErrorEval.valueOf(((ErrPtg) ptg).getErrorCode()); return ErrorEval.valueOf(((ErrPtg) ptg).getErrorCode());
} }
if (ptg instanceof MissingArgPtg) {
return MissingArgEval.instance;
}
if (ptg instanceof AreaErrPtg ||ptg instanceof RefErrorPtg if (ptg instanceof AreaErrPtg ||ptg instanceof RefErrorPtg
|| ptg instanceof DeletedArea3DPtg || ptg instanceof DeletedRef3DPtg) { || ptg instanceof DeletedArea3DPtg || ptg instanceof DeletedRef3DPtg) {
return ErrorEval.REF_INVALID; return ErrorEval.REF_INVALID;

View File

@ -36,6 +36,7 @@ public class AllFormulaEvalTests {
result.addTestSuite(TestExternalFunction.class); result.addTestSuite(TestExternalFunction.class);
result.addTestSuite(TestFormulaBugs.class); result.addTestSuite(TestFormulaBugs.class);
result.addTestSuite(TestFormulasFromSpreadsheet.class); result.addTestSuite(TestFormulasFromSpreadsheet.class);
result.addTestSuite(TestMissingArgEval.class);
result.addTestSuite(TestPercentEval.class); result.addTestSuite(TestPercentEval.class);
result.addTestSuite(TestRangeEval.class); result.addTestSuite(TestRangeEval.class);
result.addTestSuite(TestUnaryPlusEval.class); result.addTestSuite(TestUnaryPlusEval.class);

View File

@ -0,0 +1,74 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.hssf.record.formula.eval;
import java.util.EmptyStackException;
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.CellValue;
/**
* Tests for {@link MissingArgEval}
*
* @author Josh Micich
*/
public final class TestMissingArgEval extends TestCase {
public void testEvaluateMissingArgs() {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
HSSFSheet sheet = wb.createSheet("Sheet1");
HSSFCell cell = sheet.createRow(0).createCell(0);
cell.setCellFormula("if(true,)");
fe.clearAllCachedResultValues();
CellValue cv;
try {
cv = fe.evaluate(cell);
} catch (EmptyStackException e) {
throw new AssertionFailedError("Missing args evaluation not implemented (bug 43354");
}
// MissingArg -> BlankEval -> zero (as formula result)
assertEquals(0.0, cv.getNumberValue(), 0.0);
// MissingArg -> BlankEval -> empty string (in concatenation)
cell.setCellFormula("\"abc\"&if(true,)");
fe.clearAllCachedResultValues();
assertEquals("abc", fe.evaluate(cell).getStringValue());
}
public void testCountFuncs() {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
HSSFSheet sheet = wb.createSheet("Sheet1");
HSSFCell cell = sheet.createRow(0).createCell(0);
cell.setCellFormula("COUNT(C5,,,,)"); // 4 missing args, C5 is blank
assertEquals(4.0, fe.evaluate(cell).getNumberValue(), 0.0);
cell.setCellFormula("COUNTA(C5,,)"); // 2 missing args, C5 is blank
fe.clearAllCachedResultValues();
assertEquals(2.0, fe.evaluate(cell).getNumberValue(), 0.0);
}
}