<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 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">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">Created a common interface for handling Excel files, irrespective of if they are .xls or .xlsx</action>
</release>
<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">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>
* @author Glen Stampoultzis (glens at apache.org)
* @author Michael Zalewski (zalewski at optonline.net)
*/
-public abstract class AbstractEscherHolderRecord
- extends Record
-{
+public abstract class AbstractEscherHolderRecord extends Record {
private static boolean DESERIALISE;
static {
try {
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()
{
if (escherRecords.size() == 0 && rawData != null)
{
convertToEscherRecords(0, rawData.length, rawData );
}
-
-} // END OF CLASS
-
-
-
-
+}
import org.apache.poi.util.LittleEndian;
/**
- * The area format record is used to define the colours and patterns for an area.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The area format record is used to define the colours and patterns for an area.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class AreaFormatRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 4 + 4 + 2 + 2 + 2 + 2;
import org.apache.poi.util.LittleEndian;
/**
- * The area record is used to define a area chart.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The area record is used to define a area chart.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class AreaRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2;
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * The axis line format record defines the axis type details.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The axis line format record defines the axis type details.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class AxisLineFormatRecord
- extends Record
-{
+public final class AxisLineFormatRecord extends Record {
public final static short sid = 0x1021;
private short field_1_axisType;
public final static short AXIS_TYPE_AXIS_LINE = 0;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2;
{
this.field_1_axisType = field_1_axisType;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
import org.apache.poi.util.LittleEndian;
/**
- * The axis options record provides unit information and other various tidbits about the axis.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The axis options record provides unit information and other various tidbits about the axis.<p/>
+ *
* @author Andrew C. Oliver(acoliver at apache.org)
*/
public final class AxisOptionsRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2;
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * The axis size and location
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The axis size and location<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class AxisParentRecord
- extends Record
-{
+public final class AxisParentRecord extends Record {
public final static short sid = 0x1041;
private short field_1_axisType;
public final static short AXIS_TYPE_MAIN = 0;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 4 + 4 + 4 + 4;
{
this.field_5_height = field_5_height;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * The axis record defines the type of an axis.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The axis record defines the type of an axis.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class AxisRecord
- extends Record
-{
+public final class AxisRecord extends Record {
public final static short sid = 0x101d;
private short field_1_axisType;
public final static short AXIS_TYPE_CATEGORY_OR_X_AXIS = 0;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 4 + 4 + 4 + 4;
{
this.field_5_reserved4 = field_5_reserved4;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * The number of axes used on a chart.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The number of axes used on a chart.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class AxisUsedRecord
- extends Record
-{
+public final class AxisUsedRecord extends Record {
public final static short sid = 0x1046;
private short field_1_numAxis;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2;
{
this.field_1_numAxis = field_1_numAxis;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
import org.apache.poi.util.LittleEndian;
/**
- * The bar record is used to define a bar chart.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The bar record is used to define a bar chart.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class BarRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 2 + 2;
/**
- * Record for the bottom margin.
- * NOTE: This source was automatically generated.
- *
+ * Record for the bottom margin.<p/>
+ *
* @author Shawn Laubach (slaubach at apache dot org)
*/
-public class BottomMarginRecord
- extends Record implements Margin
-{
+public final class BottomMarginRecord extends Record implements Margin {
public final static short sid = 0x29;
private double field_1_margin;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 8;
return rec;
}
-} // END OF CLAS
\ No newline at end of file
+} // END OF CLA
\ No newline at end of file
import org.apache.poi.util.LittleEndian;
/**
- * This record refers to a category or series axis and is used to specify label/tickmark frequency.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * This record refers to a category or series axis and is used to specify label/tickmark frequency.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class CategorySeriesAxisRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 2 + 2 + 2;
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
* 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)
*/
-public class ChartRecord
- extends Record
-{
+public final class ChartRecord extends Record {
public final static short sid = 0x1002;
private int field_1_x;
private int field_2_y;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 4 + 4 + 4 + 4;
{
this.field_4_height = field_4_height;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
import org.apache.poi.util.LittleEndian;
/**
- * The common object data record is used to store all common preferences for an excel object.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
- *
+ * The common object data record is used to store all common preferences for an excel object.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class CommonObjectDataSubRecord extends SubRecord {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 2 + 2 + 4 + 4 + 4;
return getRecordSize();
}
- //with 4 bytes header
public int getRecordSize()
{
return 22;
import org.apache.poi.util.LittleEndian;
/**
- * The dat record is used to store options for the chart.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The dat record is used to store options for the chart.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class DatRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2;
import org.apache.poi.util.LittleEndian;
/**
- * The data format record is used to index into a series.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
- *
+ * The data format record is used to index into a series.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class DataFormatRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 2 + 2 + 2;
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * The default data label text properties record identifies the text characteristics of the preceeding text record.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The default data label text properties record identifies the text characteristics of the preceding text record.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class DefaultDataLabelTextPropertiesRecord
- extends Record
-{
+public final class DefaultDataLabelTextPropertiesRecord extends Record {
public final static short sid = 0x1024;
private short field_1_categoryDataType;
public final static short CATEGORY_DATA_TYPE_SHOW_LABELS_CHARACTERISTIC = 0;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2;
{
this.field_1_categoryDataType = field_1_categoryDataType;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
convertRawBytesToEscherRecords();
}
- /**
- * Size of record (including 4 byte headers for all sections)
- */
public int getRecordSize()
{
return grossSizeFromDataSize( getRawDataSize() );
import org.apache.poi.util.LittleEndian;
/**
- * The end data record is used to denote the end of the subrecords.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The end data record is used to denote the end of the subrecords.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class EndSubRecord extends SubRecord {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 ;
return rec;
}
-
-
-
-} // END OF CLASS
-
-
+}
return size;
}
- /**
- * The number of bytes required to serialize this record.
- */
public int getRecordSize()
{
convertUserModelToRecords();
return pos;
}
- /** Returns the size of this record */
public int getRecordSize()
{
return 6 + 8*getNumInfoRecords();
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * The font basis record stores various font metrics.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The font basis record stores various font metrics.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class FontBasisRecord
- extends Record
-{
+public final class FontBasisRecord extends Record {
public final static short sid = 0x1060;
private short field_1_xBasis;
private short field_2_yBasis;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 2 + 2 + 2 + 2;
{
this.field_5_indexToFontTable = field_5_indexToFontTable;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * The font index record indexes into the font table for the text record.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The font index record indexes into the font table for the text record.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class FontIndexRecord
- extends Record
-{
+public final class FontIndexRecord extends Record {
public final static short sid = 0x1026;
private short field_1_fontIndex;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2;
{
this.field_1_fontIndex = field_1_fontIndex;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
import org.apache.poi.util.LittleEndian;
/**
- * The frame record indicates whether there is a border around the displayed text 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.
-
+ * The frame record indicates whether there is a border around the displayed text of a chart.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class FrameRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 2;
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
* The group marker record is used as a position holder for groups.
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class GroupMarkerSubRecord
- extends SubRecord
-{
- public final static short sid = 0x06;
+public class GroupMarkerSubRecord extends SubRecord {
+ public final static short sid = 0x0006;
private byte[] reserved = new byte[0]; // would really love to know what goes in here.
public GroupMarkerSubRecord(RecordInputStream in)
{
-// int pos = 0;
reserved = in.readRemainder();
}
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + reserved.length;
rec.reserved[i] = reserved[i];
return rec;
}
-
-
-
-} // END OF CLASS
-
-
+}
package org.apache.poi.hssf.record;
-import org.apache.poi.util.*;
+import org.apache.poi.util.LittleEndian;
/**
- * Record for the left margin.
- * NOTE: This source was automatically generated.
+ * Record for the left margin.<p/>
+ *
* @author Shawn Laubach (slaubach at apache dot org)
*/
public class LeftMarginRecord extends Record implements Margin
{
- public final static short sid = 0x26;
+ public final static short sid = 0x0026;
private double field_1_margin;
public LeftMarginRecord() { }
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize() {
return 4 + 8;
}
rec.field_1_margin = this.field_1_margin;
return rec;
}
-} // END OF CLAS
\ No newline at end of file
+} // END OF CLA
\ No newline at end of file
import org.apache.poi.util.LittleEndian;
/**
- * Defines a legend for a chart.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * Defines a legend for a chart.<p/>
+ *
* @author Andrew C. Oliver (acoliver at apache.org)
*/
public final class LegendRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 4 + 4 + 4 + 4 + 1 + 1 + 2;
import org.apache.poi.util.LittleEndian;
/**
- * Describes a line format record. The line format record controls how a line on a chart appears.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * Describes a line format record. The line format record controls how a line on a chart appears.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class LineFormatRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 4 + 2 + 2 + 2 + 2;
import org.apache.poi.util.LittleEndian;
/**
- * Describes a linked data record. This record referes to the series data or text.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * Describes a linked data record. This record referes to the series data or text.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class LinkedDataRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 1 + 1 + 2 + 2 + field_5_formulaOfLink.getSize();
/**
* 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.
- * NOTE: This source wass automatically generated.
*
* @author Shawn Laubach (slaubach at apache dot org)
*/
-public interface Margin
-{
- /**
- * Get the margin field for the Margin.
- */
- public double getMargin();
+public interface Margin {
+ // TODO - introduce MarginBaseRecord
+ /**
+ * Get the margin field for the Margin.
+ */
+ public double getMargin();
- /**
- * Set the margin field for the Margin.
- */
- public void setMargin( double field_1_margin );
-} // END OF CLASS
\ No newline at end of file
+ /**
+ * Set the margin field for the Margin.
+ */
+ public void setMargin(double field_1_margin);
+}
return nChars;
}
- /** returns the record size
- */
public int getRecordSize(){
return 4 // sid + size
+ 15 // 4 shorts + 7 bytes
return getRecordSize();
}
- /**
- * Size of record
- */
public int getRecordSize()
{
int retval = 4 + 2 + 2 + 2 + 2 + 2 + 1 + field_5_author.length() + 1;
return getRecordSize();
}
- /**
- * Size of record
- */
public int getRecordSize()
{
return 4 + reserved.length;
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * The number format index record indexes format table. This applies to an axis.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The number format index record indexes format table. This applies to an axis.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class NumberFormatIndexRecord
- extends Record
-{
- public final static short sid = 0x104e;
+public final class NumberFormatIndexRecord extends Record {
+ public final static short sid = 0x104E;
private short field_1_formatIndex;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2;
{
this.field_1_formatIndex = field_1_formatIndex;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
return getRecordSize();
}
- /**
- * Size of record (excluding 4 byte header)
- */
public int getRecordSize()
{
int size = 0;
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * Links text to an object on the chart or identifies it as the title.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * Links text to an object on the chart or identifies it as the title.<p/>
+ *
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class ObjectLinkRecord
- extends Record
-{
+public final class ObjectLinkRecord extends Record {
public final static short sid = 0x1027;
private short field_1_anchorId;
public final static short ANCHOR_ID_CHART_TITLE = 1;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 2 + 2;
{
this.field_3_link2 = field_3_link2;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
import org.apache.poi.util.LittleEndian;
/**
- * Describes the frozen and unfozen panes.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * Describes the frozen and unfozen panes.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class PaneRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 2 + 2 + 2 + 2;
import org.apache.poi.util.LittleEndian;
/**
- * preceeds and identifies a frame as belonging to the plot area.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * preceeds and identifies a frame as belonging to the plot area.<p/>
+ *
* @author Andrew C. Oliver (acoliver at apache.org)
*/
public final class PlotAreaRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 ;
return rec;
}
-
-
-
-
-
-} // END OF CLASS
-
-
-
-
+}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * The plot growth record specifies the scaling factors used when a font is scaled.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The plot growth record specifies the scaling factors used when a font is scaled.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class PlotGrowthRecord
- extends Record
-{
+public final class PlotGrowthRecord extends Record {
public final static short sid = 0x1064;
private int field_1_horizontalScale;
private int field_2_verticalScale;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 4 + 4;
{
this.field_2_verticalScale = field_2_verticalScale;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
limitations under the License.
==================================================================== */
-
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;
private double field_1_margin;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize() { return 4 + 8; }
public short getSid() { return sid; }
rec.field_1_margin = this.field_1_margin;
return rec;
}
-} // END OF CLA
\ No newline at end of file
+} // END OF CL
\ No newline at end of file
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * Specifies the window's zoom magnification. If this record isn't present then the windows zoom is 100%. see p384 Excel Dev Kit
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * Specifies the window's zoom magnification. <p/>
+ * If this record isn't present then the windows zoom is 100%. see p384 Excel Dev Kit
+ *
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class SCLRecord
- extends Record
-{
- public final static short sid = 0xa0;
+public final class SCLRecord extends Record {
+ public final static short sid = 0x00A0;
private short field_1_numerator;
private short field_2_denominator;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 2;
{
this.field_2_denominator = field_2_denominator;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * The series chart group index record stores the index to the CHARTFORMAT record (0 based).
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The series chart group index record stores the index to the CHARTFORMAT record (0 based).<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class SeriesChartGroupIndexRecord
- extends Record
-{
+public final class SeriesChartGroupIndexRecord extends Record {
public final static short sid = 0x1045;
private short field_1_chartGroupIndex;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2;
{
this.field_1_chartGroupIndex = field_1_chartGroupIndex;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * links a series to its position in the series list.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * links a series to its position in the series list.<p/>
+ *
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class SeriesIndexRecord
- extends Record
-{
+public final class SeriesIndexRecord extends Record {
public final static short sid = 0x1065;
private short field_1_index;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2;
{
this.field_1_index = field_1_index;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
import org.apache.poi.util.LittleEndian;
/**
- * The series label record defines the type of label associated with the data format record.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The series label record defines the type of label associated with the data format record.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class SeriesLabelsRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2;
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * The series record describes the overall data for a series.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The series record describes the overall data for a series.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class SeriesRecord
- extends Record
-{
+public final class SeriesRecord extends Record {
public final static short sid = 0x1003;
private short field_1_categoryDataType;
public final static short CATEGORY_DATA_TYPE_DATES = 0;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 2 + 2 + 2 + 2 + 2;
{
this.field_6_numBubbleValues = field_6_numBubbleValues;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.StringUtil;
/**
- * Defines a series name
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * Defines a series name</p>
+ *
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class SeriesTextRecord
- extends Record
-{
+public final class SeriesTextRecord extends Record {
public final static short sid = 0x100d;
private short field_1_id;
private byte field_2_textLength;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 1 + 1 + (field_2_textLength *2);
{
this.field_4_text = field_4_text;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * 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)
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * 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)<p/>
+ *
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class SeriesToChartGroupRecord
- extends Record
-{
+public final class SeriesToChartGroupRecord extends Record {
public final static short sid = 0x1045;
private short field_1_chartGroupIndex;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2;
{
this.field_1_chartGroupIndex = field_1_chartGroupIndex;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
import org.apache.poi.util.LittleEndian;
/**
- * Describes a chart sheet properties record.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * Describes a chart sheet properties record.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class SheetPropertiesRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 1;
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()
{
return 4 + 2 + 1 + getStringByteLength();
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.BitField;
+import org.apache.poi.util.BitFieldFactory;
+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
- 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.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * 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.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
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 HorizontalTextAlignment = BitFieldFactory.getInstance(0x000E);
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4;
import org.apache.poi.util.LittleEndian;
/**
- * The text record is used to define text stored on a chart.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The text record is used to define text stored on a chart.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class TextRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 1 + 1 + 2 + 4 + 4 + 4 + 4 + 4 + 2 + 2 + 2 + 2;
import org.apache.poi.util.LittleEndian;
/**
- * The Tick record defines how tick marks and label positioning/formatting
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The Tick record defines how tick marks and label positioning/formatting<p/>
+ *
* @author Andrew C. Oliver(acoliver at apache.org)
*/
public final class TickRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 1 + 1 + 1 + 1 + 4 + 8 + 8 + 2 + 2 + 2;
import org.apache.poi.util.*;
/**
- * Record for the top margin.
- * NOTE: This source was automatically generated.
- *
+ * Record for the top margin.<p/>
+ *
* @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;
private double field_1_margin;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize() { return 4 + 8; }
public short getSid() { return sid; }
rec.field_1_margin = this.field_1_margin;
return rec;
}
-} // END OF CLAS
\ No newline at end of file
+} // END OF CLA
\ No newline at end of file
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hssf.record;
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
/**
- * The units record describes units.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The units record describes units.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class UnitsRecord
- extends Record
-{
+public final class UnitsRecord extends Record {
public final static short sid = 0x1001;
private short field_1_units;
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 2;
{
this.field_1_units = field_1_units;
}
-
-
-} // END OF CLASS
-
-
-
-
+}
import org.apache.poi.util.LittleEndian;
/**
- * The value range record defines the range of the value axis.
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
+ * The value range record defines the range of the value axis.<p/>
+ *
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class ValueRangeRecord extends Record {
return getRecordSize();
}
- /**
- * Size of record (exluding 4 byte header)
- */
public int getRecordSize()
{
return 4 + 8 + 8 + 8 + 8 + 8 + 2;
--- /dev/null
+/* ====================================================================
+ 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() {
+ }
+}
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.MissingArgEval;
import org.apache.poi.hssf.record.formula.eval.NumberEval;
import org.apache.poi.hssf.record.formula.functions.CountUtils.I_MatchPredicate;
// only numbers are counted
return true;
}
+ if(valueEval == MissingArgEval.instance) {
+ // oh yeah, and missing arguments
+ return true;
+ }
// error values and string values not counted
return false;
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.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.NameXEval;
import org.apache.poi.hssf.record.formula.eval.NumberEval;
continue;
}
if (ptg instanceof MemErrPtg) { continue; }
- if (ptg instanceof MissingArgPtg) {
- // TODO - might need to push BlankEval or MissingArgEval
- continue;
- }
+
Eval opResult;
if (ptg instanceof OperationPtg) {
OperationPtg optg = (OperationPtg) ptg;
}
// logDebug("invoke " + operation + " (nAgs=" + numops + ")");
opResult = invokeOperation(operation, ops, _workbook, sheetIndex, srcRowNum, srcColNum);
+ if (opResult == MissingArgEval.instance) {
+ opResult = BlankEval.INSTANCE;
+ }
} else {
opResult = getEvalForPtg(ptg, sheetIndex, tracker);
}
if (ptg instanceof ErrPtg) {
return ErrorEval.valueOf(((ErrPtg) ptg).getErrorCode());
}
+ if (ptg instanceof MissingArgPtg) {
+ return MissingArgEval.instance;
+ }
if (ptg instanceof AreaErrPtg ||ptg instanceof RefErrorPtg
|| ptg instanceof DeletedArea3DPtg || ptg instanceof DeletedRef3DPtg) {
return ErrorEval.REF_INVALID;
result.addTestSuite(TestExternalFunction.class);
result.addTestSuite(TestFormulaBugs.class);
result.addTestSuite(TestFormulasFromSpreadsheet.class);
+ result.addTestSuite(TestMissingArgEval.class);
result.addTestSuite(TestPercentEval.class);
result.addTestSuite(TestRangeEval.class);
result.addTestSuite(TestUnaryPlusEval.class);
--- /dev/null
+/* ====================================================================
+ 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);
+ }
+}