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>
</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>

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>
</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>

View File

@ -36,9 +36,7 @@ import org.apache.poi.util.LittleEndian;
* @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 {
@ -133,34 +131,6 @@ public abstract class AbstractEscherHolderRecord
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)
@ -323,9 +293,4 @@ public abstract class AbstractEscherHolderRecord
{
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;
/**
* 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 {
@ -112,9 +110,6 @@ 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;

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
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 {
@ -77,9 +75,6 @@ public final class AreaRecord extends Record {
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;

View File

@ -1,4 +1,3 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -77,9 +70,6 @@ public class AxisLineFormatRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;
@ -128,10 +118,4 @@ public class AxisLineFormatRecord
{
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;
/**
* 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 {
@ -144,9 +142,6 @@ 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;

View File

@ -1,4 +1,3 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -103,9 +96,6 @@ public class AxisParentRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2 + 4 + 4 + 4 + 4;
@ -218,10 +208,4 @@ public class AxisParentRecord
{
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
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -104,9 +97,6 @@ public class AxisRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2 + 4 + 4 + 4 + 4;
@ -221,10 +211,4 @@ public class AxisRecord
{
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
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -73,9 +66,6 @@ public class AxisUsedRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;
@ -111,10 +101,4 @@ public class AxisUsedRecord
{
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;
/**
* 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 {
@ -94,9 +92,6 @@ public final class BarRecord extends Record {
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2 + 2 + 2;

View File

@ -23,14 +23,11 @@ import org.apache.poi.util.*;
/**
* 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;
@ -62,9 +59,6 @@ public class BottomMarginRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 8;
@ -98,4 +92,4 @@ public class BottomMarginRecord
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;
/**
* 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 {
@ -99,9 +97,6 @@ public final class CategorySeriesAxisRecord extends Record {
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2 + 2 + 2 + 2;

View File

@ -1,4 +1,3 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,17 @@
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;
@ -94,9 +86,6 @@ public class ChartRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 4 + 4 + 4 + 4;
@ -183,10 +172,4 @@ public class ChartRecord
{
this.field_4_height = field_4_height;
}
} // END OF CLASS
}

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
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 {
@ -147,9 +145,6 @@ 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;

View File

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

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
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 {
@ -80,9 +78,6 @@ public final class DatRecord extends Record {
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
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 {
@ -95,9 +93,6 @@ public final class DataFormatRecord extends Record {
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2 + 2 + 2 + 2;

View File

@ -1,4 +1,3 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -76,9 +69,6 @@ public class DefaultDataLabelTextPropertiesRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;
@ -125,10 +115,4 @@ public class DefaultDataLabelTextPropertiesRecord
{
this.field_1_categoryDataType = field_1_categoryDataType;
}
} // END OF CLASS
}

View File

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

View File

@ -20,10 +20,8 @@ package org.apache.poi.hssf.record;
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 {
@ -61,9 +59,6 @@ public final class EndSubRecord extends SubRecord {
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 ;
@ -79,9 +74,4 @@ public final class EndSubRecord extends SubRecord {
return rec;
}
} // END OF CLASS
}

View File

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

View File

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

View File

@ -1,4 +1,3 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -101,9 +94,6 @@ public class FontBasisRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2 + 2 + 2 + 2 + 2;
@ -207,10 +197,4 @@ public class FontBasisRecord
{
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
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -73,9 +66,6 @@ public class FontIndexRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;
@ -111,10 +101,4 @@ public class FontIndexRecord
{
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;
/**
* 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 {
@ -85,9 +83,6 @@ public final class FrameRecord extends Record {
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2 + 2;

View File

@ -1,4 +1,3 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,19 @@
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.
@ -43,7 +37,6 @@ public class GroupMarkerSubRecord
public GroupMarkerSubRecord(RecordInputStream in)
{
// int pos = 0;
reserved = in.readRemainder();
}
@ -67,9 +60,6 @@ public class GroupMarkerSubRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + reserved.length;
@ -87,9 +77,4 @@ public class GroupMarkerSubRecord
rec.reserved[i] = reserved[i];
return rec;
}
} // END OF CLASS
}

View File

@ -17,16 +17,16 @@
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() { }
@ -53,9 +53,6 @@ public class LeftMarginRecord extends Record implements Margin
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() {
return 4 + 8;
}
@ -85,4 +82,4 @@ public class LeftMarginRecord extends Record implements Margin
rec.field_1_margin = this.field_1_margin;
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;
/**
* 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 {
@ -135,9 +133,6 @@ 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;

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
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 {
@ -120,9 +118,6 @@ 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;

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
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 {
@ -110,9 +108,6 @@ 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();

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.
* 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
/**
* Set the margin field for the Margin.
*/
public void setMargin(double field_1_margin);
}

View File

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

View File

@ -100,9 +100,6 @@ public class NoteRecord extends Record {
return getRecordSize();
}
/**
* Size of record
*/
public int getRecordSize()
{
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();
}
/**
* Size of record
*/
public int getRecordSize()
{
return 4 + reserved.length;

View File

@ -1,4 +1,3 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,25 +14,19 @@
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;
@ -73,9 +66,6 @@ public class NumberFormatIndexRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;
@ -111,10 +101,4 @@ public class NumberFormatIndexRecord
{
this.field_1_formatIndex = field_1_formatIndex;
}
} // END OF CLASS
}

View File

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

View File

@ -1,4 +1,3 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -93,9 +86,6 @@ public class ObjectLinkRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2 + 2 + 2;
@ -180,10 +170,4 @@ public class ObjectLinkRecord
{
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;
/**
* 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 {
@ -104,9 +102,6 @@ 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;

View File

@ -20,10 +20,8 @@ package org.apache.poi.hssf.record;
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 {
@ -62,9 +60,6 @@ public final class PlotAreaRecord extends Record {
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 ;
@ -80,13 +75,4 @@ public final class PlotAreaRecord extends Record {
return rec;
}
} // END OF CLASS
}

View File

@ -1,4 +1,3 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -81,9 +74,6 @@ public class PlotGrowthRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 4 + 4;
@ -136,10 +126,4 @@ public class PlotGrowthRecord
{
this.field_2_verticalScale = field_2_verticalScale;
}
} // END OF CLASS
}

View File

@ -15,16 +15,16 @@
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;
@ -52,9 +52,6 @@ public class RightMarginRecord extends Record implements Margin
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() { return 4 + 8; }
public short getSid() { return sid; }
@ -76,4 +73,4 @@ public class RightMarginRecord extends Record implements Margin
rec.field_1_margin = this.field_1_margin;
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
contributor license agreements. See the NOTICE file distributed with
@ -15,25 +14,20 @@
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;
@ -80,9 +74,6 @@ public class SCLRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2 + 2;
@ -135,10 +126,4 @@ public class SCLRecord
{
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
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -73,9 +66,6 @@ public class SeriesChartGroupIndexRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;
@ -111,10 +101,4 @@ public class SeriesChartGroupIndexRecord
{
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
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -73,9 +66,6 @@ public class SeriesIndexRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;
@ -111,10 +101,4 @@ public class SeriesIndexRecord
{
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;
/**
* 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 {
@ -83,9 +81,6 @@ public final class SeriesLabelsRecord extends Record {
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;

View File

@ -1,4 +1,3 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -121,9 +114,6 @@ public class SeriesRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2 + 2 + 2 + 2 + 2 + 2;
@ -283,10 +273,4 @@ public class SeriesRecord
{
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
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,19 @@
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;
@ -94,9 +88,6 @@ public class SeriesTextRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2 + 1 + 1 + (field_2_textLength *2);
@ -199,10 +190,4 @@ public class SeriesTextRecord
{
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
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,20 @@
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;
@ -73,9 +68,6 @@ public class SeriesToChartGroupRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;
@ -111,10 +103,4 @@ public class SeriesToChartGroupRecord
{
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;
/**
* 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 {
@ -92,9 +90,6 @@ public final class SheetPropertiesRecord extends Record {
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
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;
}
/**
* gives the current serialized size of the record. Should include the sid and reclength (4 bytes).
*/
public int getRecordSize()
{
return 4 + 2 + 1 + getStringByteLength();

View File

@ -19,21 +19,21 @@
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);
@ -149,9 +149,6 @@ public class TextObjectBaseRecord extends Record {
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
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;
/**
* 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 {
@ -204,9 +202,6 @@ 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;

View File

@ -23,10 +23,8 @@ import org.apache.poi.util.HexDump;
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 {
@ -151,9 +149,6 @@ 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;

View File

@ -20,13 +20,11 @@ package org.apache.poi.hssf.record;
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;
@ -57,9 +55,6 @@ public class TopMarginRecord extends Record implements Margin
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize() { return 4 + 8; }
public short getSid() { return sid; }
@ -81,4 +76,4 @@ public class TopMarginRecord extends Record implements Margin
rec.field_1_margin = this.field_1_margin;
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
contributor license agreements. See the NOTICE file distributed with
@ -15,24 +14,18 @@
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;
@ -74,9 +67,6 @@ public class UnitsRecord
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;
@ -112,10 +102,4 @@ public class UnitsRecord
{
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;
/**
* 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 {
@ -121,9 +119,6 @@ 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;

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.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;
@ -64,6 +65,10 @@ public final class Count implements Function {
// 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;

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.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;
@ -284,10 +285,7 @@ public final class WorkbookEvaluator {
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;
@ -306,6 +304,9 @@ public final class WorkbookEvaluator {
}
// 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);
}
@ -424,6 +425,9 @@ public final class WorkbookEvaluator {
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;

View File

@ -36,6 +36,7 @@ public class AllFormulaEvalTests {
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);

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);
}
}