You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ye...@apache.org on 2009/06/07 17:39:55 UTC
svn commit: r782402 [7/8] - in /poi/tags/REL_3_5_BETA6: ./
src/contrib/src/org/apache/poi/contrib/poibrowser/ src/documentation/
src/documentation/content/xdocs/ src/documentation/content/xdocs/hpsf/
src/documentation/content/xdocs/news/ src/documentat...
Modified: poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/ss/usermodel/Cell.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/ss/usermodel/Cell.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/ss/usermodel/Cell.java (original)
+++ poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/ss/usermodel/Cell.java Sun Jun 7 15:39:51 2009
@@ -149,11 +149,19 @@
void setCellValue(double value);
/**
- * Set a boolean value for the cell
- *
- * @param value the boolean value to set this cell to. For formulas we'll set the
- * precalculated value, for booleans we'll set its value. For other types we
- * will change the cell to a boolean cell and set its value.
+ * Converts the supplied date to its equivalent Excel numeric value and sets
+ * that into the cell.
+ * <p/>
+ * <b>Note</b> - There is actually no 'DATE' cell type in Excel. In many
+ * cases (when entering date values), Excel automatically adjusts the
+ * <i>cell style</i> to some date format, creating the illusion that the cell
+ * data type is now something besides {@link Cell#CELL_TYPE_NUMERIC}. POI
+ * does not attempt to replicate this behaviour. To make a numeric cell
+ * display as a date, use {@link #setCellStyle(CellStyle)} etc.
+ *
+ * @param value the numeric value to set this cell to. For formulas we'll set the
+ * precalculated value, for numerics we'll set its value. For other types we
+ * will change the cell to a numerics cell and set its value.
*/
void setCellValue(Date value);
Modified: poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/ss/usermodel/Sheet.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/ss/usermodel/Sheet.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/ss/usermodel/Sheet.java (original)
+++ poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/ss/usermodel/Sheet.java Sun Jun 7 15:39:51 2009
@@ -182,7 +182,7 @@
* @param height default row height
*/
void setDefaultRowHeightInPoints(float height);
-
+
/**
* Returns the CellStyle that applies to the given
* (0 based) column, or null if no style has been
@@ -275,7 +275,7 @@
/**
* Set whether the window should show 0 (zero) in cells containing zero value.
* When false, cells with zero value appear blank instead of showing the number zero.
- *
+ *
* @param value whether to display or hide all zero values on the worksheet
*/
void setDisplayZeros(boolean value);
@@ -407,18 +407,19 @@
/**
* Gets the user model for the default document header.
- * <p>
+ * <p/>
* Note that XSSF offers more kinds of document headers than HSSF does
* </p>
- * @return the document header.
+ * @return the document header. Never <code>null</code>
*/
Header getHeader();
/**
* Gets the user model for the default document footer.
+ * <p/>
* Note that XSSF offers more kinds of document footers than HSSF does.
*
- * @return the document footer.
+ * @return the document footer. Never <code>null</code>
*/
Footer getFooter();
@@ -473,7 +474,7 @@
void setZoom(int numerator, int denominator);
/**
- * The top row in the visible view when the sheet is
+ * The top row in the visible view when the sheet is
* first viewed after opening it in a viewer
*
* @return short indicating the rownum (0 based) of the top row
@@ -481,7 +482,7 @@
short getTopRow();
/**
- * The left col in the visible view when the sheet is
+ * The left col in the visible view when the sheet is
* first viewed after opening it in a viewer
*
* @return short indicating the rownum (0 based) of the top row
@@ -489,7 +490,7 @@
short getLeftCol();
/**
- * Sets desktop window pane display area, when the
+ * Sets desktop window pane display area, when the
* file is first opened in a viewer.
*
* @param toprow the top row to show in desktop window pane
Modified: poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/ss/util/CellReference.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/ss/util/CellReference.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/ss/util/CellReference.java (original)
+++ poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/ss/util/CellReference.java Sun Jun 7 15:39:51 2009
@@ -21,7 +21,6 @@
import java.util.regex.Pattern;
import org.apache.poi.hssf.record.formula.SheetNameFormatter;
-import org.apache.poi.hssf.record.formula.function.FunctionMetadataRegistry;
import org.apache.poi.ss.SpreadsheetVersion;
/**
@@ -40,21 +39,21 @@
public static final int BAD_CELL_OR_NAMED_RANGE = -1;
}
- /** The character ($) that signifies a row or column value is absolute instead of relative */
+ /** The character ($) that signifies a row or column value is absolute instead of relative */
private static final char ABSOLUTE_REFERENCE_MARKER = '$';
- /** The character (!) that separates sheet names from cell references */
+ /** The character (!) that separates sheet names from cell references */
private static final char SHEET_NAME_DELIMITER = '!';
/** The character (') used to quote sheet names when they contain special characters */
private static final char SPECIAL_NAME_DELIMITER = '\'';
-
+
/**
* Matches a run of one or more letters followed by a run of one or more digits.
- * The run of letters is group 1 and the run of digits is group 2.
+ * The run of letters is group 1 and the run of digits is group 2.
* Each group may optionally be prefixed with a single '$'.
*/
private static final Pattern CELL_REF_PATTERN = Pattern.compile("\\$?([A-Za-z]+)\\$?([0-9]+)");
/**
- * Matches a run of one or more letters. The run of letters is group 1.
+ * Matches a run of one or more letters. The run of letters is group 1.
* The text may optionally be prefixed with a single '$'.
*/
private static final Pattern COLUMN_REF_PATTERN = Pattern.compile("\\$?([A-Za-z]+)");
@@ -68,11 +67,11 @@
//private static final String BIFF8_LAST_ROW = String.valueOf(SpreadsheetVersion.EXCEL97.getMaxRows());
//private static final int BIFF8_LAST_ROW_TEXT_LEN = BIFF8_LAST_ROW.length();
- private final int _rowIndex;
- private final int _colIndex;
- private final String _sheetName;
- private final boolean _isRowAbs;
- private final boolean _isColAbs;
+ private final int _rowIndex;
+ private final int _colIndex;
+ private final String _sheetName;
+ private final boolean _isRowAbs;
+ private final boolean _isColAbs;
/**
* Create an cell ref from a string representation. Sheet names containing special characters should be
@@ -81,7 +80,7 @@
public CellReference(String cellRef) {
String[] parts = separateRefParts(cellRef);
_sheetName = parts[0];
- String colRef = parts[1];
+ String colRef = parts[1];
if (colRef.length() < 1) {
throw new IllegalArgumentException("Invalid Formula cell reference: '"+cellRef+"'");
}
@@ -90,7 +89,7 @@
colRef=colRef.substring(1);
}
_colIndex = convertColStringToIndex(colRef);
-
+
String rowRef=parts[2];
if (rowRef.length() < 1) {
throw new IllegalArgumentException("Invalid Formula cell reference: '"+cellRef+"'");
@@ -139,7 +138,7 @@
public String getSheetName(){
return _sheetName;
}
-
+
public static boolean isPartAbsolute(String part) {
return part.charAt(0) == ABSOLUTE_REFERENCE_MARKER;
}
@@ -153,7 +152,7 @@
* @return zero based column index
*/
public static int convertColStringToIndex(String ref) {
-
+
int pos = 0;
int retval=0;
for (int k = ref.length()-1; k >= 0; k--) {
@@ -175,7 +174,7 @@
/**
* Classifies an identifier as either a simple (2D) cell reference or a named range name
- * @return one of the values from <tt>NameType</tt>
+ * @return one of the values from <tt>NameType</tt>
*/
public static int classifyCellReference(String str, SpreadsheetVersion ssVersion) {
int len = str.length();
@@ -190,7 +189,7 @@
break;
default:
if (!Character.isLetter(firstChar)) {
- throw new IllegalArgumentException("Invalid first char (" + firstChar
+ throw new IllegalArgumentException("Invalid first char (" + firstChar
+ ") of cell reference or named range. Letter expected");
}
}
@@ -204,7 +203,7 @@
}
String lettersGroup = cellRefPatternMatcher.group(1);
String digitsGroup = cellRefPatternMatcher.group(2);
- if (cellReferenceIsWithinRange(lettersGroup, digitsGroup, ssVersion)) {
+ if (cellReferenceIsWithinRange(lettersGroup, digitsGroup, ssVersion)) {
// valid cell reference
return NameType.CELL;
}
@@ -233,17 +232,17 @@
}
return NameType.NAMED_RANGE;
}
-
-
+
+
/**
- * Used to decide whether a name of the form "[A-Z]*[0-9]*" that appears in a formula can be
+ * Used to decide whether a name of the form "[A-Z]*[0-9]*" that appears in a formula can be
* interpreted as a cell reference. Names of that form can be also used for sheets and/or
- * named ranges, and in those circumstances, the question of whether the potential cell
+ * named ranges, and in those circumstances, the question of whether the potential cell
* reference is valid (in range) becomes important.
* <p/>
* Note - that the maximum sheet size varies across Excel versions:
* <p/>
- * <blockquote><table border="0" cellpadding="1" cellspacing="0"
+ * <blockquote><table border="0" cellpadding="1" cellspacing="0"
* summary="Notable cases.">
* <tr><th>Version </th><th>File Format </th>
* <th>Last Column </th><th>Last Row</th></tr>
@@ -252,7 +251,7 @@
* </table></blockquote>
* POI currently targets BIFF8 (Excel 97-2003), so the following behaviour can be observed for
* this method:
- * <blockquote><table border="0" cellpadding="1" cellspacing="0"
+ * <blockquote><table border="0" cellpadding="1" cellspacing="0"
* summary="Notable cases.">
* <tr><th>Input </th>
* <th>Result </th></tr>
@@ -266,7 +265,7 @@
* <tr><td>"a", "111"</td><td>true</td></tr>
* <tr><td>"Sheet", "1"</td><td>false</td></tr>
* </table></blockquote>
- *
+ *
* @param colStr a string of only letter characters
* @param rowStr a string of only digit characters
* @return <code>true</code> if the row and col parameters are within range of a BIFF8 spreadsheet.
@@ -275,30 +274,23 @@
if (!isColumnWithnRange(colStr, ssVersion)) {
return false;
}
- String lastRow = String.valueOf(ssVersion.getMaxRows());
- int lastRowLen = lastRow.length();
- int nDigits = rowStr.length();
- if(nDigits > lastRowLen) {
- return false;
- }
-
- if(nDigits == lastRowLen) {
- // ASCII comparison is valid if digit count is same
- if(rowStr.compareTo(lastRow) > 0) {
- return false;
- }
- } else {
- // apparent row has less chars than max
- // no need to check range
+ int rowNum = Integer.parseInt(rowStr);
+
+ if (rowNum < 0) {
+ throw new IllegalStateException("Invalid rowStr '" + rowStr + "'.");
}
-
- return true;
+ if (rowNum == 0) {
+ // execution gets here because caller does first pass of discriminating
+ // potential cell references using a simplistic regex pattern.
+ return false;
+ }
+ return rowNum <= ssVersion.getMaxRows();
}
public static boolean isColumnWithnRange(String colStr, SpreadsheetVersion ssVersion) {
- String lastCol = ssVersion.getLastColumnName();
- int lastColLength = lastCol.length();
+ String lastCol = ssVersion.getLastColumnName();
+ int lastColLength = lastCol.length();
int numberOfLetters = colStr.length();
if(numberOfLetters > lastColLength) {
@@ -318,11 +310,11 @@
/**
* Separates the row from the columns and returns an array of three Strings. The first element
- * is the sheet name. Only the first element may be null. The second element in is the column
+ * is the sheet name. Only the first element may be null. The second element in is the column
* name still in ALPHA-26 number format. The third element is the row.
*/
private static String[] separateRefParts(String reference) {
-
+
int plingPos = reference.lastIndexOf(SHEET_NAME_DELIMITER);
String sheetName = parseSheetName(reference, plingPos);
int start = plingPos+1;
@@ -331,7 +323,7 @@
int loc = start;
- // skip initial dollars
+ // skip initial dollars
if (reference.charAt(loc)==ABSOLUTE_REFERENCE_MARKER) {
loc++;
}
@@ -343,9 +335,9 @@
}
}
return new String[] {
- sheetName,
- reference.substring(start,loc),
- reference.substring(loc),
+ sheetName,
+ reference.substring(start,loc),
+ reference.substring(loc),
};
}
@@ -353,7 +345,7 @@
if(indexOfSheetNameDelimiter < 0) {
return null;
}
-
+
boolean isQuoted = reference.charAt(0) == SPECIAL_NAME_DELIMITER;
if(!isQuoted) {
return reference.substring(0, indexOfSheetNameDelimiter);
@@ -364,14 +356,14 @@
}
// TODO - refactor cell reference parsing logic to one place.
- // Current known incarnations:
+ // Current known incarnations:
// FormulaParser.GetName()
// CellReference.parseSheetName() (here)
- // AreaReference.separateAreaRefs()
+ // AreaReference.separateAreaRefs()
// SheetNameFormatter.format() (inverse)
-
+
StringBuffer sb = new StringBuffer(indexOfSheetNameDelimiter);
-
+
for(int i=1; i<lastQuotePos; i++) { // Note boundaries - skip outer quotes
char ch = reference.charAt(i);
if(ch != SPECIAL_NAME_DELIMITER) {
@@ -400,20 +392,20 @@
// Excel counts column A as the 1st column, we
// treat it as the 0th one
int excelColNum = col + 1;
-
+
String colRef = "";
int colRemain = excelColNum;
-
+
while(colRemain > 0) {
int thisPart = colRemain % 26;
if(thisPart == 0) { thisPart = 26; }
colRemain = (colRemain - thisPart) / 26;
-
+
// The letter A is at 65
char colChar = (char)(thisPart+64);
colRef = colChar + colRef;
}
-
+
return colRef;
}
@@ -436,7 +428,7 @@
appendCellReference(sb);
return sb.toString();
}
-
+
public String toString() {
StringBuffer sb = new StringBuffer(64);
sb.append(getClass().getName()).append(" [");
@@ -451,7 +443,7 @@
* row number, and the A based column letter.
* This will not include any markers for absolute
* references, so use {@link #formatAsString()}
- * to properly turn references into strings.
+ * to properly turn references into strings.
*/
public String[] getCellRefParts() {
return new String[] {
Modified: poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/util/ArrayUtil.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/util/ArrayUtil.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/util/ArrayUtil.java (original)
+++ poi/tags/REL_3_5_BETA6/src/java/org/apache/poi/util/ArrayUtil.java Sun Jun 7 15:39:51 2009
@@ -21,7 +21,6 @@
* Utility classes for dealing with arrays.
*
* @author Glen Stampoultzis
- * @version $Id$
*/
public class ArrayUtil
{
Modified: poi/tags/REL_3_5_BETA6/src/records/styles/record_document.xsl
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/records/styles/record_document.xsl?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/records/styles/record_document.xsl (original)
+++ poi/tags/REL_3_5_BETA6/src/records/styles/record_document.xsl Sun Jun 7 15:39:51 2009
@@ -50,7 +50,6 @@
<footer>
<legal>
Copyright (c) @year@ The Poi Project All rights reserved.
- $Revision$ $Date$
</legal>
</footer>
Modified: poi/tags/REL_3_5_BETA6/src/resources/main/org/apache/poi/hssf/record/formula/function/functionMetadata-asGenerated.txt
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/resources/main/org/apache/poi/hssf/record/formula/function/functionMetadata-asGenerated.txt?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/resources/main/org/apache/poi/hssf/record/formula/function/functionMetadata-asGenerated.txt (original)
+++ poi/tags/REL_3_5_BETA6/src/resources/main/org/apache/poi/hssf/record/formula/function/functionMetadata-asGenerated.txt Sun Jun 7 15:39:51 2009
@@ -1,285 +1,285 @@
-# 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.
-
-# Created by (org.apache.poi.hssf.record.formula.function.ExcelFileFormatDocFunctionExtractor)
-# from source file 'excelfileformat.odt' (size=356107, md5=0x8f789cb6e75594caf068f8e193004ef4)
-#
-#Columns: (index, name, minParams, maxParams, returnClass, paramClasses, isVolatile, hasFootnote )
-
-# Built-In Sheet Functions in BIFF2
-0 COUNT 0 30 V R
-1 IF 2 3 R V R R
-2 ISNA 1 1 V V
-3 ISERROR 1 1 V V
-4 SUM 0 30 V R
-5 AVERAGE 1 30 V R
-6 MIN 1 30 V R
-7 MAX 1 30 V R
-8 ROW 0 1 V R
-9 COLUMN 0 1 V R
-10 NA 0 0 V -
-11 NPV 2 30 V V R
-12 STDEV 1 30 V R
-13 DOLLAR 1 2 V V V
-14 FIXED 2 2 V V V x
-15 SIN 1 1 V V
-16 COS 1 1 V V
-17 TAN 1 1 V V
-18 ATAN 1 1 V V
-19 PI 0 0 V -
-20 SQRT 1 1 V V
-21 EXP 1 1 V V
-22 LN 1 1 V V
-23 LOG10 1 1 V V
-24 ABS 1 1 V V
-25 INT 1 1 V V
-26 SIGN 1 1 V V
-27 ROUND 2 2 V V V
-28 LOOKUP 2 3 V V R R
-29 INDEX 2 4 R R V V V
-30 REPT 2 2 V V V
-31 MID 3 3 V V V V
-32 LEN 1 1 V V
-33 VALUE 1 1 V V
-34 TRUE 0 0 V -
-35 FALSE 0 0 V -
-36 AND 1 30 V R
-37 OR 1 30 V R
-38 NOT 1 1 V V
-39 MOD 2 2 V V V
-40 DCOUNT 3 3 V R R R
-41 DSUM 3 3 V R R R
-42 DAVERAGE 3 3 V R R R
-43 DMIN 3 3 V R R R
-44 DMAX 3 3 V R R R
-45 DSTDEV 3 3 V R R R
-46 VAR 1 30 V R
-47 DVAR 3 3 V R R R
-48 TEXT 2 2 V V V
-49 LINEST 1 2 A R R x
-50 TREND 1 3 A R R R x
-51 LOGEST 1 2 A R R x
-52 GROWTH 1 3 A R R R x
-56 PV 3 5 V V V V V V
-# Built-In Sheet Functions in BIFF2
-57 FV 3 5 V V V V V V
-58 NPER 3 5 V V V V V V
-59 PMT 3 5 V V V V V V
-60 RATE 3 6 V V V V V V V
-61 MIRR 3 3 V R V V
-62 IRR 1 2 V R V
-63 RAND 0 0 V - x
-64 MATCH 2 3 V V R R
-65 DATE 3 3 V V V V
-66 TIME 3 3 V V V V
-67 DAY 1 1 V V
-68 MONTH 1 1 V V
-69 YEAR 1 1 V V
-70 WEEKDAY 1 1 V V x
-71 HOUR 1 1 V V
-72 MINUTE 1 1 V V
-73 SECOND 1 1 V V
-74 NOW 0 0 V - x
-75 AREAS 1 1 V R
-76 ROWS 1 1 V R
-77 COLUMNS 1 1 V R
-78 OFFSET 3 5 R R V V V V x
-82 SEARCH 2 3 V V V V
-83 TRANSPOSE 1 1 A A
-86 TYPE 1 1 V V
-97 ATAN2 2 2 V V V
-98 ASIN 1 1 V V
-99 ACOS 1 1 V V
-100 CHOOSE 2 30 R V R
-101 HLOOKUP 3 3 V V R R x
-102 VLOOKUP 3 3 V V R R x
-105 ISREF 1 1 V R
-109 LOG 1 2 V V V
-111 CHAR 1 1 V V
-112 LOWER 1 1 V V
-113 UPPER 1 1 V V
-114 PROPER 1 1 V V
-115 LEFT 1 2 V V V
-116 RIGHT 1 2 V V V
-117 EXACT 2 2 V V V
-118 TRIM 1 1 V V
-119 REPLACE 4 4 V V V V V
-120 SUBSTITUTE 3 4 V V V V V
-121 CODE 1 1 V V
-124 FIND 2 3 V V V V
-125 CELL 1 2 V V R x
-126 ISERR 1 1 V V
-127 ISTEXT 1 1 V V
-128 ISNUMBER 1 1 V V
-129 ISBLANK 1 1 V V
-130 T 1 1 V R
-131 N 1 1 V R
-140 DATEVALUE 1 1 V V
-141 TIMEVALUE 1 1 V V
-142 SLN 3 3 V V V V
-143 SYD 4 4 V V V V V
-144 DDB 4 5 V V V V V V
-148 INDIRECT 1 2 R V V x
-162 CLEAN 1 1 V V
-163 MDETERM 1 1 V A
-164 MINVERSE 1 1 A A
-165 MMULT 2 2 A A A
-167 IPMT 4 6 V V V V V V V
-168 PPMT 4 6 V V V V V V V
-169 COUNTA 0 30 V R
-183 PRODUCT 0 30 V R
-184 FACT 1 1 V V
-189 DPRODUCT 3 3 V R R R
-190 ISNONTEXT 1 1 V V
-193 STDEVP 1 30 V R
-194 VARP 1 30 V R
-195 DSTDEVP 3 3 V R R R
-196 DVARP 3 3 V R R R
-197 TRUNC 1 1 V V x
-198 ISLOGICAL 1 1 V V
-199 DCOUNTA 3 3 V R R R
-# New Built-In Sheet Functions in BIFF3
-49 LINEST 1 4 A R R V V x
-50 TREND 1 4 A R R R V x
-51 LOGEST 1 4 A R R V V x
-52 GROWTH 1 4 A R R R V x
-197 TRUNC 1 2 V V V x
-204 YEN 1 2 V V V x
-205 FINDB 2 3 V V V V
-206 SEARCHB 2 3 V V V V
-207 REPLACEB 4 4 V V V V V
-208 LEFTB 1 2 V V V
-209 RIGHTB 1 2 V V V
-210 MIDB 3 3 V V V V
-211 LENB 1 1 V V
-212 ROUNDUP 2 2 V V V
-213 ROUNDDOWN 2 2 V V V
-214 ASC 1 1 V V
-215 JIS 1 1 V V x
-219 ADDRESS 2 5 V V V V V V
-220 DAYS360 2 2 V V V x
-221 TODAY 0 0 V - x
-222 VDB 5 7 V V V V V V V V
-227 MEDIAN 1 30 V R ...
-228 SUMPRODUCT 1 30 V A ...
-229 SINH 1 1 V V
-230 COSH 1 1 V V
-231 TANH 1 1 V V
-232 ASINH 1 1 V V
-233 ACOSH 1 1 V V
-234 ATANH 1 1 V V
-235 DGET 3 3 V R R R
-244 INFO 1 1 V V
-# New Built-In Sheet Functions in BIFF4
-14 FIXED 2 3 V V V V x
-204 USDOLLAR 1 2 V V V x
-215 DBCS 1 1 V V x
-216 RANK 2 3 V V R V
-247 DB 4 5 V V V V V V
-252 FREQUENCY 2 2 A R R
-261 ERROR.TYPE 1 1 V V
-269 AVEDEV 1 30 V R ...
-270 BETADIST 3 5 V V V V V V
-271 GAMMALN 1 1 V V
-272 BETAINV 3 5 V V V V V V
-273 BINOMDIST 4 4 V V V V V
-274 CHIDIST 2 2 V V V
-275 CHIINV 2 2 V V V
-276 COMBIN 2 2 V V V
-277 CONFIDENCE 3 3 V V V V
-278 CRITBINOM 3 3 V V V V
-279 EVEN 1 1 V V
-280 EXPONDIST 3 3 V V V V
-281 FDIST 3 3 V V V V
-282 FINV 3 3 V V V V
-283 FISHER 1 1 V V
-284 FISHERINV 1 1 V V
-285 FLOOR 2 2 V V V
-286 GAMMADIST 4 4 V V V V V
-287 GAMMAINV 3 3 V V V V
-288 CEILING 2 2 V V V
-289 HYPGEOMDIST 4 4 V V V V V
-290 LOGNORMDIST 3 3 V V V V
-291 LOGINV 3 3 V V V V
-292 NEGBINOMDIST 3 3 V V V V
-293 NORMDIST 4 4 V V V V V
-294 NORMSDIST 1 1 V V
-295 NORMINV 3 3 V V V V
-296 NORMSINV 1 1 V V
-297 STANDARDIZE 3 3 V V V V
-298 ODD 1 1 V V
-299 PERMUT 2 2 V V V
-300 POISSON 3 3 V V V V
-301 TDIST 3 3 V V V V
-302 WEIBULL 4 4 V V V V V
-303 SUMXMY2 2 2 V A A
-304 SUMX2MY2 2 2 V A A
-305 SUMX2PY2 2 2 V A A
-306 CHITEST 2 2 V A A
-307 CORREL 2 2 V A A
-308 COVAR 2 2 V A A
-309 FORECAST 3 3 V V A A
-310 FTEST 2 2 V A A
-311 INTERCEPT 2 2 V A A
-312 PEARSON 2 2 V A A
-313 RSQ 2 2 V A A
-314 STEYX 2 2 V A A
-315 SLOPE 2 2 V A A
-316 TTEST 4 4 V A A V V
-317 PROB 3 4 V A A V V
-318 DEVSQ 1 30 V R ...
-319 GEOMEAN 1 30 V R ...
-320 HARMEAN 1 30 V R ...
-321 SUMSQ 0 30 V R ...
-322 KURT 1 30 V R ...
-323 SKEW 1 30 V R ...
-324 ZTEST 2 3 V R V V
-325 LARGE 2 2 V R V
-326 SMALL 2 2 V R V
-327 QUARTILE 2 2 V R V
-328 PERCENTILE 2 2 V R V
-329 PERCENTRANK 2 3 V R V V
-330 MODE 1 30 V A
-331 TRIMMEAN 2 2 V R V
-332 TINV 2 2 V V V
-# New Built-In Sheet Functions in BIFF5
-70 WEEKDAY 1 2 V V V x
-101 HLOOKUP 3 4 V V R R V x
-102 VLOOKUP 3 4 V V R R V x
-220 DAYS360 2 3 V V V V x
-336 CONCATENATE 0 30 V V
-337 POWER 2 2 V V V
-342 RADIANS 1 1 V V
-343 DEGREES 1 1 V V
-344 SUBTOTAL 2 30 V V R
-345 SUMIF 2 3 V R V R
-346 COUNTIF 2 2 V R V
-347 COUNTBLANK 1 1 V R
-350 ISPMT 4 4 V V V V V
-351 DATEDIF 3 3 V V V V
-352 DATESTRING 1 1 V V
-353 NUMBERSTRING 2 2 V V V
-354 ROMAN 1 2 V V V
-# New Built-In Sheet Functions in BIFF8
-358 GETPIVOTDATA 2 30
-359 HYPERLINK 1 2 V V V
-360 PHONETIC 1 1 V R
-361 AVERAGEA 1 30 V R ...
-362 MAXA 1 30 V R ...
-363 MINA 1 30 V R ...
-364 STDEVPA 1 30 V R ...
-365 VARPA 1 30 V R ...
-366 STDEVA 1 30 V R ...
-367 VARA 1 30 V R ...
+# 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.
+
+# Created by (org.apache.poi.hssf.record.formula.function.ExcelFileFormatDocFunctionExtractor)
+# from source file 'excelfileformat.odt' (size=356107, md5=0x8f789cb6e75594caf068f8e193004ef4)
+#
+#Columns: (index, name, minParams, maxParams, returnClass, paramClasses, isVolatile, hasFootnote )
+
+# Built-In Sheet Functions in BIFF2
+0 COUNT 0 30 V R
+1 IF 2 3 R V R R
+2 ISNA 1 1 V V
+3 ISERROR 1 1 V V
+4 SUM 0 30 V R
+5 AVERAGE 1 30 V R
+6 MIN 1 30 V R
+7 MAX 1 30 V R
+8 ROW 0 1 V R
+9 COLUMN 0 1 V R
+10 NA 0 0 V -
+11 NPV 2 30 V V R
+12 STDEV 1 30 V R
+13 DOLLAR 1 2 V V V
+14 FIXED 2 2 V V V x
+15 SIN 1 1 V V
+16 COS 1 1 V V
+17 TAN 1 1 V V
+18 ATAN 1 1 V V
+19 PI 0 0 V -
+20 SQRT 1 1 V V
+21 EXP 1 1 V V
+22 LN 1 1 V V
+23 LOG10 1 1 V V
+24 ABS 1 1 V V
+25 INT 1 1 V V
+26 SIGN 1 1 V V
+27 ROUND 2 2 V V V
+28 LOOKUP 2 3 V V R R
+29 INDEX 2 4 R R V V V
+30 REPT 2 2 V V V
+31 MID 3 3 V V V V
+32 LEN 1 1 V V
+33 VALUE 1 1 V V
+34 TRUE 0 0 V -
+35 FALSE 0 0 V -
+36 AND 1 30 V R
+37 OR 1 30 V R
+38 NOT 1 1 V V
+39 MOD 2 2 V V V
+40 DCOUNT 3 3 V R R R
+41 DSUM 3 3 V R R R
+42 DAVERAGE 3 3 V R R R
+43 DMIN 3 3 V R R R
+44 DMAX 3 3 V R R R
+45 DSTDEV 3 3 V R R R
+46 VAR 1 30 V R
+47 DVAR 3 3 V R R R
+48 TEXT 2 2 V V V
+49 LINEST 1 2 A R R x
+50 TREND 1 3 A R R R x
+51 LOGEST 1 2 A R R x
+52 GROWTH 1 3 A R R R x
+56 PV 3 5 V V V V V V
+# Built-In Sheet Functions in BIFF2
+57 FV 3 5 V V V V V V
+58 NPER 3 5 V V V V V V
+59 PMT 3 5 V V V V V V
+60 RATE 3 6 V V V V V V V
+61 MIRR 3 3 V R V V
+62 IRR 1 2 V R V
+63 RAND 0 0 V - x
+64 MATCH 2 3 V V R R
+65 DATE 3 3 V V V V
+66 TIME 3 3 V V V V
+67 DAY 1 1 V V
+68 MONTH 1 1 V V
+69 YEAR 1 1 V V
+70 WEEKDAY 1 1 V V x
+71 HOUR 1 1 V V
+72 MINUTE 1 1 V V
+73 SECOND 1 1 V V
+74 NOW 0 0 V - x
+75 AREAS 1 1 V R
+76 ROWS 1 1 V R
+77 COLUMNS 1 1 V R
+78 OFFSET 3 5 R R V V V V x
+82 SEARCH 2 3 V V V V
+83 TRANSPOSE 1 1 A A
+86 TYPE 1 1 V V
+97 ATAN2 2 2 V V V
+98 ASIN 1 1 V V
+99 ACOS 1 1 V V
+100 CHOOSE 2 30 R V R
+101 HLOOKUP 3 3 V V R R x
+102 VLOOKUP 3 3 V V R R x
+105 ISREF 1 1 V R
+109 LOG 1 2 V V V
+111 CHAR 1 1 V V
+112 LOWER 1 1 V V
+113 UPPER 1 1 V V
+114 PROPER 1 1 V V
+115 LEFT 1 2 V V V
+116 RIGHT 1 2 V V V
+117 EXACT 2 2 V V V
+118 TRIM 1 1 V V
+119 REPLACE 4 4 V V V V V
+120 SUBSTITUTE 3 4 V V V V V
+121 CODE 1 1 V V
+124 FIND 2 3 V V V V
+125 CELL 1 2 V V R x
+126 ISERR 1 1 V V
+127 ISTEXT 1 1 V V
+128 ISNUMBER 1 1 V V
+129 ISBLANK 1 1 V V
+130 T 1 1 V R
+131 N 1 1 V R
+140 DATEVALUE 1 1 V V
+141 TIMEVALUE 1 1 V V
+142 SLN 3 3 V V V V
+143 SYD 4 4 V V V V V
+144 DDB 4 5 V V V V V V
+148 INDIRECT 1 2 R V V x
+162 CLEAN 1 1 V V
+163 MDETERM 1 1 V A
+164 MINVERSE 1 1 A A
+165 MMULT 2 2 A A A
+167 IPMT 4 6 V V V V V V V
+168 PPMT 4 6 V V V V V V V
+169 COUNTA 0 30 V R
+183 PRODUCT 0 30 V R
+184 FACT 1 1 V V
+189 DPRODUCT 3 3 V R R R
+190 ISNONTEXT 1 1 V V
+193 STDEVP 1 30 V R
+194 VARP 1 30 V R
+195 DSTDEVP 3 3 V R R R
+196 DVARP 3 3 V R R R
+197 TRUNC 1 1 V V x
+198 ISLOGICAL 1 1 V V
+199 DCOUNTA 3 3 V R R R
+# New Built-In Sheet Functions in BIFF3
+49 LINEST 1 4 A R R V V x
+50 TREND 1 4 A R R R V x
+51 LOGEST 1 4 A R R V V x
+52 GROWTH 1 4 A R R R V x
+197 TRUNC 1 2 V V V x
+204 YEN 1 2 V V V x
+205 FINDB 2 3 V V V V
+206 SEARCHB 2 3 V V V V
+207 REPLACEB 4 4 V V V V V
+208 LEFTB 1 2 V V V
+209 RIGHTB 1 2 V V V
+210 MIDB 3 3 V V V V
+211 LENB 1 1 V V
+212 ROUNDUP 2 2 V V V
+213 ROUNDDOWN 2 2 V V V
+214 ASC 1 1 V V
+215 JIS 1 1 V V x
+219 ADDRESS 2 5 V V V V V V
+220 DAYS360 2 2 V V V x
+221 TODAY 0 0 V - x
+222 VDB 5 7 V V V V V V V V
+227 MEDIAN 1 30 V R ...
+228 SUMPRODUCT 1 30 V A ...
+229 SINH 1 1 V V
+230 COSH 1 1 V V
+231 TANH 1 1 V V
+232 ASINH 1 1 V V
+233 ACOSH 1 1 V V
+234 ATANH 1 1 V V
+235 DGET 3 3 V R R R
+244 INFO 1 1 V V
+# New Built-In Sheet Functions in BIFF4
+14 FIXED 2 3 V V V V x
+204 USDOLLAR 1 2 V V V x
+215 DBCS 1 1 V V x
+216 RANK 2 3 V V R V
+247 DB 4 5 V V V V V V
+252 FREQUENCY 2 2 A R R
+261 ERROR.TYPE 1 1 V V
+269 AVEDEV 1 30 V R ...
+270 BETADIST 3 5 V V V V V V
+271 GAMMALN 1 1 V V
+272 BETAINV 3 5 V V V V V V
+273 BINOMDIST 4 4 V V V V V
+274 CHIDIST 2 2 V V V
+275 CHIINV 2 2 V V V
+276 COMBIN 2 2 V V V
+277 CONFIDENCE 3 3 V V V V
+278 CRITBINOM 3 3 V V V V
+279 EVEN 1 1 V V
+280 EXPONDIST 3 3 V V V V
+281 FDIST 3 3 V V V V
+282 FINV 3 3 V V V V
+283 FISHER 1 1 V V
+284 FISHERINV 1 1 V V
+285 FLOOR 2 2 V V V
+286 GAMMADIST 4 4 V V V V V
+287 GAMMAINV 3 3 V V V V
+288 CEILING 2 2 V V V
+289 HYPGEOMDIST 4 4 V V V V V
+290 LOGNORMDIST 3 3 V V V V
+291 LOGINV 3 3 V V V V
+292 NEGBINOMDIST 3 3 V V V V
+293 NORMDIST 4 4 V V V V V
+294 NORMSDIST 1 1 V V
+295 NORMINV 3 3 V V V V
+296 NORMSINV 1 1 V V
+297 STANDARDIZE 3 3 V V V V
+298 ODD 1 1 V V
+299 PERMUT 2 2 V V V
+300 POISSON 3 3 V V V V
+301 TDIST 3 3 V V V V
+302 WEIBULL 4 4 V V V V V
+303 SUMXMY2 2 2 V A A
+304 SUMX2MY2 2 2 V A A
+305 SUMX2PY2 2 2 V A A
+306 CHITEST 2 2 V A A
+307 CORREL 2 2 V A A
+308 COVAR 2 2 V A A
+309 FORECAST 3 3 V V A A
+310 FTEST 2 2 V A A
+311 INTERCEPT 2 2 V A A
+312 PEARSON 2 2 V A A
+313 RSQ 2 2 V A A
+314 STEYX 2 2 V A A
+315 SLOPE 2 2 V A A
+316 TTEST 4 4 V A A V V
+317 PROB 3 4 V A A V V
+318 DEVSQ 1 30 V R ...
+319 GEOMEAN 1 30 V R ...
+320 HARMEAN 1 30 V R ...
+321 SUMSQ 0 30 V R ...
+322 KURT 1 30 V R ...
+323 SKEW 1 30 V R ...
+324 ZTEST 2 3 V R V V
+325 LARGE 2 2 V R V
+326 SMALL 2 2 V R V
+327 QUARTILE 2 2 V R V
+328 PERCENTILE 2 2 V R V
+329 PERCENTRANK 2 3 V R V V
+330 MODE 1 30 V A
+331 TRIMMEAN 2 2 V R V
+332 TINV 2 2 V V V
+# New Built-In Sheet Functions in BIFF5
+70 WEEKDAY 1 2 V V V x
+101 HLOOKUP 3 4 V V R R V x
+102 VLOOKUP 3 4 V V R R V x
+220 DAYS360 2 3 V V V V x
+336 CONCATENATE 0 30 V V
+337 POWER 2 2 V V V
+342 RADIANS 1 1 V V
+343 DEGREES 1 1 V V
+344 SUBTOTAL 2 30 V V R
+345 SUMIF 2 3 V R V R
+346 COUNTIF 2 2 V R V
+347 COUNTBLANK 1 1 V R
+350 ISPMT 4 4 V V V V V
+351 DATEDIF 3 3 V V V V
+352 DATESTRING 1 1 V V
+353 NUMBERSTRING 2 2 V V V
+354 ROMAN 1 2 V V V
+# New Built-In Sheet Functions in BIFF8
+358 GETPIVOTDATA 2 30
+359 HYPERLINK 1 2 V V V
+360 PHONETIC 1 1 V R
+361 AVERAGEA 1 30 V R ...
+362 MAXA 1 30 V R ...
+363 MINA 1 30 V R ...
+364 STDEVPA 1 30 V R ...
+365 VARPA 1 30 V R ...
+366 STDEVA 1 30 V R ...
+367 VARA 1 30 V R ...
Modified: poi/tags/REL_3_5_BETA6/src/resources/main/org/apache/poi/hssf/record/formula/function/functionMetadata.txt
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/resources/main/org/apache/poi/hssf/record/formula/function/functionMetadata.txt?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/resources/main/org/apache/poi/hssf/record/formula/function/functionMetadata.txt (original)
+++ poi/tags/REL_3_5_BETA6/src/resources/main/org/apache/poi/hssf/record/formula/function/functionMetadata.txt Sun Jun 7 15:39:51 2009
@@ -1,286 +1,286 @@
-# 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.
-
-# Created by (org.apache.poi.hssf.record.formula.function.ExcelFileFormatDocFunctionExtractor)
-# from source file 'excelfileformat.odt' (size=356107, md5=0x8f789cb6e75594caf068f8e193004ef4)
-# ! + some manual edits !
-#
-#Columns: (index, name, minParams, maxParams, returnClass, paramClasses, isVolatile, hasFootnote )
-
-# Built-In Sheet Functions in BIFF2
-0 COUNT 0 30 V R
-1 IF 2 3 R V R R
-2 ISNA 1 1 V V
-3 ISERROR 1 1 V V
-4 SUM 0 30 V R
-5 AVERAGE 1 30 V R
-6 MIN 1 30 V R
-7 MAX 1 30 V R
-8 ROW 0 1 V R
-9 COLUMN 0 1 V R
-10 NA 0 0 V -
-11 NPV 2 30 V V R
-12 STDEV 1 30 V R
-13 DOLLAR 1 2 V V V
-14 FIXED 2 2 V V V x
-15 SIN 1 1 V V
-16 COS 1 1 V V
-17 TAN 1 1 V V
-18 ATAN 1 1 V V
-19 PI 0 0 V -
-20 SQRT 1 1 V V
-21 EXP 1 1 V V
-22 LN 1 1 V V
-23 LOG10 1 1 V V
-24 ABS 1 1 V V
-25 INT 1 1 V V
-26 SIGN 1 1 V V
-27 ROUND 2 2 V V V
-28 LOOKUP 2 3 V V R R
-29 INDEX 2 4 R R V V V
-30 REPT 2 2 V V V
-31 MID 3 3 V V V V
-32 LEN 1 1 V V
-33 VALUE 1 1 V V
-34 TRUE 0 0 V -
-35 FALSE 0 0 V -
-36 AND 1 30 V R
-37 OR 1 30 V R
-38 NOT 1 1 V V
-39 MOD 2 2 V V V
-40 DCOUNT 3 3 V R R R
-41 DSUM 3 3 V R R R
-42 DAVERAGE 3 3 V R R R
-43 DMIN 3 3 V R R R
-44 DMAX 3 3 V R R R
-45 DSTDEV 3 3 V R R R
-46 VAR 1 30 V R
-47 DVAR 3 3 V R R R
-48 TEXT 2 2 V V V
-49 LINEST 1 2 A R R x
-50 TREND 1 3 A R R R x
-51 LOGEST 1 2 A R R x
-52 GROWTH 1 3 A R R R x
-56 PV 3 5 V V V V V V
-# Built-In Sheet Functions in BIFF2
-57 FV 3 5 V V V V V V
-58 NPER 3 5 V V V V V V
-59 PMT 3 5 V V V V V V
-60 RATE 3 6 V V V V V V V
-61 MIRR 3 3 V A V V
-62 IRR 1 2 V A V
-63 RAND 0 0 V - x
-64 MATCH 2 3 V V R R
-65 DATE 3 3 V V V V
-66 TIME 3 3 V V V V
-67 DAY 1 1 V V
-68 MONTH 1 1 V V
-69 YEAR 1 1 V V
-70 WEEKDAY 1 1 V V x
-71 HOUR 1 1 V V
-72 MINUTE 1 1 V V
-73 SECOND 1 1 V V
-74 NOW 0 0 V - x
-75 AREAS 1 1 V R
-76 ROWS 1 1 V A
-77 COLUMNS 1 1 V A
-78 OFFSET 3 5 R R V V V V x
-82 SEARCH 2 3 V V V V
-83 TRANSPOSE 1 1 A A
-86 TYPE 1 1 V V
-97 ATAN2 2 2 V V V
-98 ASIN 1 1 V V
-99 ACOS 1 1 V V
-100 CHOOSE 2 30 R V R
-101 HLOOKUP 3 3 V V R R x
-102 VLOOKUP 3 3 V V R R x
-105 ISREF 1 1 V R
-109 LOG 1 2 V V V
-111 CHAR 1 1 V V
-112 LOWER 1 1 V V
-113 UPPER 1 1 V V
-114 PROPER 1 1 V V
-115 LEFT 1 2 V V V
-116 RIGHT 1 2 V V V
-117 EXACT 2 2 V V V
-118 TRIM 1 1 V V
-119 REPLACE 4 4 V V V V V
-120 SUBSTITUTE 3 4 V V V V V
-121 CODE 1 1 V V
-124 FIND 2 3 V V V V
-125 CELL 1 2 V V R x
-126 ISERR 1 1 V V
-127 ISTEXT 1 1 V V
-128 ISNUMBER 1 1 V V
-129 ISBLANK 1 1 V V
-130 T 1 1 V R
-131 N 1 1 V R
-140 DATEVALUE 1 1 V V
-141 TIMEVALUE 1 1 V V
-142 SLN 3 3 V V V V
-143 SYD 4 4 V V V V V
-144 DDB 4 5 V V V V V V
-148 INDIRECT 1 2 R V V x
-162 CLEAN 1 1 V V
-163 MDETERM 1 1 V A
-164 MINVERSE 1 1 A A
-165 MMULT 2 2 A A A
-167 IPMT 4 6 V V V V V V V
-168 PPMT 4 6 V V V V V V V
-169 COUNTA 0 30 V R
-183 PRODUCT 0 30 V R
-184 FACT 1 1 V V
-189 DPRODUCT 3 3 V R R R
-190 ISNONTEXT 1 1 V V
-193 STDEVP 1 30 V R
-194 VARP 1 30 V R
-195 DSTDEVP 3 3 V R R R
-196 DVARP 3 3 V R R R
-197 TRUNC 1 1 V V x
-198 ISLOGICAL 1 1 V V
-199 DCOUNTA 3 3 V R R R
-# New Built-In Sheet Functions in BIFF3
-49 LINEST 1 4 A R R V V x
-50 TREND 1 4 A R R R V x
-51 LOGEST 1 4 A R R V V x
-52 GROWTH 1 4 A R R R V x
-197 TRUNC 1 2 V V V x
-204 YEN 1 2 V V V x
-205 FINDB 2 3 V V V V
-206 SEARCHB 2 3 V V V V
-207 REPLACEB 4 4 V V V V V
-208 LEFTB 1 2 V V V
-209 RIGHTB 1 2 V V V
-210 MIDB 3 3 V V V V
-211 LENB 1 1 V V
-212 ROUNDUP 2 2 V V V
-213 ROUNDDOWN 2 2 V V V
-214 ASC 1 1 V V
-215 JIS 1 1 V V x
-219 ADDRESS 2 5 V V V V V V
-220 DAYS360 2 2 V V V x
-221 TODAY 0 0 V - x
-222 VDB 5 7 V V V V V V V V
-227 MEDIAN 1 30 V R ...
-228 SUMPRODUCT 1 30 V A ...
-229 SINH 1 1 V V
-230 COSH 1 1 V V
-231 TANH 1 1 V V
-232 ASINH 1 1 V V
-233 ACOSH 1 1 V V
-234 ATANH 1 1 V V
-235 DGET 3 3 V R R R
-244 INFO 1 1 V V
-# New Built-In Sheet Functions in BIFF4
-14 FIXED 2 3 V V V V x
-204 USDOLLAR 1 2 V V V x
-215 DBCS 1 1 V V x
-216 RANK 2 3 V V R V
-247 DB 4 5 V V V V V V
-252 FREQUENCY 2 2 A R R
-261 ERROR.TYPE 1 1 V V
-269 AVEDEV 1 30 V R ...
-270 BETADIST 3 5 V V V V V V
-271 GAMMALN 1 1 V V
-272 BETAINV 3 5 V V V V V V
-273 BINOMDIST 4 4 V V V V V
-274 CHIDIST 2 2 V V V
-275 CHIINV 2 2 V V V
-276 COMBIN 2 2 V V V
-277 CONFIDENCE 3 3 V V V V
-278 CRITBINOM 3 3 V V V V
-279 EVEN 1 1 V V
-280 EXPONDIST 3 3 V V V V
-281 FDIST 3 3 V V V V
-282 FINV 3 3 V V V V
-283 FISHER 1 1 V V
-284 FISHERINV 1 1 V V
-285 FLOOR 2 2 V V V
-286 GAMMADIST 4 4 V V V V V
-287 GAMMAINV 3 3 V V V V
-288 CEILING 2 2 V V V
-289 HYPGEOMDIST 4 4 V V V V V
-290 LOGNORMDIST 3 3 V V V V
-291 LOGINV 3 3 V V V V
-292 NEGBINOMDIST 3 3 V V V V
-293 NORMDIST 4 4 V V V V V
-294 NORMSDIST 1 1 V V
-295 NORMINV 3 3 V V V V
-296 NORMSINV 1 1 V V
-297 STANDARDIZE 3 3 V V V V
-298 ODD 1 1 V V
-299 PERMUT 2 2 V V V
-300 POISSON 3 3 V V V V
-301 TDIST 3 3 V V V V
-302 WEIBULL 4 4 V V V V V
-303 SUMXMY2 2 2 V A A
-304 SUMX2MY2 2 2 V A A
-305 SUMX2PY2 2 2 V A A
-306 CHITEST 2 2 V A A
-307 CORREL 2 2 V A A
-308 COVAR 2 2 V A A
-309 FORECAST 3 3 V V A A
-310 FTEST 2 2 V A A
-311 INTERCEPT 2 2 V A A
-312 PEARSON 2 2 V A A
-313 RSQ 2 2 V A A
-314 STEYX 2 2 V A A
-315 SLOPE 2 2 V A A
-316 TTEST 4 4 V A A V V
-317 PROB 3 4 V A A V V
-318 DEVSQ 1 30 V R ...
-319 GEOMEAN 1 30 V R ...
-320 HARMEAN 1 30 V R ...
-321 SUMSQ 0 30 V R ...
-322 KURT 1 30 V R ...
-323 SKEW 1 30 V R ...
-324 ZTEST 2 3 V R V V
-325 LARGE 2 2 V R V
-326 SMALL 2 2 V R V
-327 QUARTILE 2 2 V R V
-328 PERCENTILE 2 2 V R V
-329 PERCENTRANK 2 3 V R V V
-330 MODE 1 30 V A
-331 TRIMMEAN 2 2 V R V
-332 TINV 2 2 V V V
-# New Built-In Sheet Functions in BIFF5
-70 WEEKDAY 1 2 V V V x
-101 HLOOKUP 3 4 V V R R V x
-102 VLOOKUP 3 4 V V R R V x
-220 DAYS360 2 3 V V V V x
-336 CONCATENATE 0 30 V V
-337 POWER 2 2 V V V
-342 RADIANS 1 1 V V
-343 DEGREES 1 1 V V
-344 SUBTOTAL 2 30 V V R
-345 SUMIF 2 3 V R V R
-346 COUNTIF 2 2 V R V
-347 COUNTBLANK 1 1 V R
-350 ISPMT 4 4 V V V V V
-351 DATEDIF 3 3 V V V V
-352 DATESTRING 1 1 V V
-353 NUMBERSTRING 2 2 V V V
-354 ROMAN 1 2 V V V
-# New Built-In Sheet Functions in BIFF8
-358 GETPIVOTDATA 2 30
-359 HYPERLINK 1 2 V V V
-360 PHONETIC 1 1 V R
-361 AVERAGEA 1 30 V R ...
-362 MAXA 1 30 V R ...
-363 MINA 1 30 V R ...
-364 STDEVPA 1 30 V R ...
-365 VARPA 1 30 V R ...
-366 STDEVA 1 30 V R ...
-367 VARA 1 30 V R ...
+# 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.
+
+# Created by (org.apache.poi.hssf.record.formula.function.ExcelFileFormatDocFunctionExtractor)
+# from source file 'excelfileformat.odt' (size=356107, md5=0x8f789cb6e75594caf068f8e193004ef4)
+# ! + some manual edits !
+#
+#Columns: (index, name, minParams, maxParams, returnClass, paramClasses, isVolatile, hasFootnote )
+
+# Built-In Sheet Functions in BIFF2
+0 COUNT 0 30 V R
+1 IF 2 3 R V R R
+2 ISNA 1 1 V V
+3 ISERROR 1 1 V V
+4 SUM 0 30 V R
+5 AVERAGE 1 30 V R
+6 MIN 1 30 V R
+7 MAX 1 30 V R
+8 ROW 0 1 V R
+9 COLUMN 0 1 V R
+10 NA 0 0 V -
+11 NPV 2 30 V V R
+12 STDEV 1 30 V R
+13 DOLLAR 1 2 V V V
+14 FIXED 2 2 V V V x
+15 SIN 1 1 V V
+16 COS 1 1 V V
+17 TAN 1 1 V V
+18 ATAN 1 1 V V
+19 PI 0 0 V -
+20 SQRT 1 1 V V
+21 EXP 1 1 V V
+22 LN 1 1 V V
+23 LOG10 1 1 V V
+24 ABS 1 1 V V
+25 INT 1 1 V V
+26 SIGN 1 1 V V
+27 ROUND 2 2 V V V
+28 LOOKUP 2 3 V V R R
+29 INDEX 2 4 R R V V V
+30 REPT 2 2 V V V
+31 MID 3 3 V V V V
+32 LEN 1 1 V V
+33 VALUE 1 1 V V
+34 TRUE 0 0 V -
+35 FALSE 0 0 V -
+36 AND 1 30 V R
+37 OR 1 30 V R
+38 NOT 1 1 V V
+39 MOD 2 2 V V V
+40 DCOUNT 3 3 V R R R
+41 DSUM 3 3 V R R R
+42 DAVERAGE 3 3 V R R R
+43 DMIN 3 3 V R R R
+44 DMAX 3 3 V R R R
+45 DSTDEV 3 3 V R R R
+46 VAR 1 30 V R
+47 DVAR 3 3 V R R R
+48 TEXT 2 2 V V V
+49 LINEST 1 2 A R R x
+50 TREND 1 3 A R R R x
+51 LOGEST 1 2 A R R x
+52 GROWTH 1 3 A R R R x
+56 PV 3 5 V V V V V V
+# Built-In Sheet Functions in BIFF2
+57 FV 3 5 V V V V V V
+58 NPER 3 5 V V V V V V
+59 PMT 3 5 V V V V V V
+60 RATE 3 6 V V V V V V V
+61 MIRR 3 3 V A V V
+62 IRR 1 2 V A V
+63 RAND 0 0 V - x
+64 MATCH 2 3 V V R R
+65 DATE 3 3 V V V V
+66 TIME 3 3 V V V V
+67 DAY 1 1 V V
+68 MONTH 1 1 V V
+69 YEAR 1 1 V V
+70 WEEKDAY 1 1 V V x
+71 HOUR 1 1 V V
+72 MINUTE 1 1 V V
+73 SECOND 1 1 V V
+74 NOW 0 0 V - x
+75 AREAS 1 1 V R
+76 ROWS 1 1 V A
+77 COLUMNS 1 1 V A
+78 OFFSET 3 5 R R V V V V x
+82 SEARCH 2 3 V V V V
+83 TRANSPOSE 1 1 A A
+86 TYPE 1 1 V V
+97 ATAN2 2 2 V V V
+98 ASIN 1 1 V V
+99 ACOS 1 1 V V
+100 CHOOSE 2 30 R V R
+101 HLOOKUP 3 3 V V R R x
+102 VLOOKUP 3 3 V V R R x
+105 ISREF 1 1 V R
+109 LOG 1 2 V V V
+111 CHAR 1 1 V V
+112 LOWER 1 1 V V
+113 UPPER 1 1 V V
+114 PROPER 1 1 V V
+115 LEFT 1 2 V V V
+116 RIGHT 1 2 V V V
+117 EXACT 2 2 V V V
+118 TRIM 1 1 V V
+119 REPLACE 4 4 V V V V V
+120 SUBSTITUTE 3 4 V V V V V
+121 CODE 1 1 V V
+124 FIND 2 3 V V V V
+125 CELL 1 2 V V R x
+126 ISERR 1 1 V V
+127 ISTEXT 1 1 V V
+128 ISNUMBER 1 1 V V
+129 ISBLANK 1 1 V V
+130 T 1 1 V R
+131 N 1 1 V R
+140 DATEVALUE 1 1 V V
+141 TIMEVALUE 1 1 V V
+142 SLN 3 3 V V V V
+143 SYD 4 4 V V V V V
+144 DDB 4 5 V V V V V V
+148 INDIRECT 1 2 R V V x
+162 CLEAN 1 1 V V
+163 MDETERM 1 1 V A
+164 MINVERSE 1 1 A A
+165 MMULT 2 2 A A A
+167 IPMT 4 6 V V V V V V V
+168 PPMT 4 6 V V V V V V V
+169 COUNTA 0 30 V R
+183 PRODUCT 0 30 V R
+184 FACT 1 1 V V
+189 DPRODUCT 3 3 V R R R
+190 ISNONTEXT 1 1 V V
+193 STDEVP 1 30 V R
+194 VARP 1 30 V R
+195 DSTDEVP 3 3 V R R R
+196 DVARP 3 3 V R R R
+197 TRUNC 1 1 V V x
+198 ISLOGICAL 1 1 V V
+199 DCOUNTA 3 3 V R R R
+# New Built-In Sheet Functions in BIFF3
+49 LINEST 1 4 A R R V V x
+50 TREND 1 4 A R R R V x
+51 LOGEST 1 4 A R R V V x
+52 GROWTH 1 4 A R R R V x
+197 TRUNC 1 2 V V V x
+204 YEN 1 2 V V V x
+205 FINDB 2 3 V V V V
+206 SEARCHB 2 3 V V V V
+207 REPLACEB 4 4 V V V V V
+208 LEFTB 1 2 V V V
+209 RIGHTB 1 2 V V V
+210 MIDB 3 3 V V V V
+211 LENB 1 1 V V
+212 ROUNDUP 2 2 V V V
+213 ROUNDDOWN 2 2 V V V
+214 ASC 1 1 V V
+215 JIS 1 1 V V x
+219 ADDRESS 2 5 V V V V V V
+220 DAYS360 2 2 V V V x
+221 TODAY 0 0 V - x
+222 VDB 5 7 V V V V V V V V
+227 MEDIAN 1 30 V R ...
+228 SUMPRODUCT 1 30 V A ...
+229 SINH 1 1 V V
+230 COSH 1 1 V V
+231 TANH 1 1 V V
+232 ASINH 1 1 V V
+233 ACOSH 1 1 V V
+234 ATANH 1 1 V V
+235 DGET 3 3 V R R R
+244 INFO 1 1 V V
+# New Built-In Sheet Functions in BIFF4
+14 FIXED 2 3 V V V V x
+204 USDOLLAR 1 2 V V V x
+215 DBCS 1 1 V V x
+216 RANK 2 3 V V R V
+247 DB 4 5 V V V V V V
+252 FREQUENCY 2 2 A R R
+261 ERROR.TYPE 1 1 V V
+269 AVEDEV 1 30 V R ...
+270 BETADIST 3 5 V V V V V V
+271 GAMMALN 1 1 V V
+272 BETAINV 3 5 V V V V V V
+273 BINOMDIST 4 4 V V V V V
+274 CHIDIST 2 2 V V V
+275 CHIINV 2 2 V V V
+276 COMBIN 2 2 V V V
+277 CONFIDENCE 3 3 V V V V
+278 CRITBINOM 3 3 V V V V
+279 EVEN 1 1 V V
+280 EXPONDIST 3 3 V V V V
+281 FDIST 3 3 V V V V
+282 FINV 3 3 V V V V
+283 FISHER 1 1 V V
+284 FISHERINV 1 1 V V
+285 FLOOR 2 2 V V V
+286 GAMMADIST 4 4 V V V V V
+287 GAMMAINV 3 3 V V V V
+288 CEILING 2 2 V V V
+289 HYPGEOMDIST 4 4 V V V V V
+290 LOGNORMDIST 3 3 V V V V
+291 LOGINV 3 3 V V V V
+292 NEGBINOMDIST 3 3 V V V V
+293 NORMDIST 4 4 V V V V V
+294 NORMSDIST 1 1 V V
+295 NORMINV 3 3 V V V V
+296 NORMSINV 1 1 V V
+297 STANDARDIZE 3 3 V V V V
+298 ODD 1 1 V V
+299 PERMUT 2 2 V V V
+300 POISSON 3 3 V V V V
+301 TDIST 3 3 V V V V
+302 WEIBULL 4 4 V V V V V
+303 SUMXMY2 2 2 V A A
+304 SUMX2MY2 2 2 V A A
+305 SUMX2PY2 2 2 V A A
+306 CHITEST 2 2 V A A
+307 CORREL 2 2 V A A
+308 COVAR 2 2 V A A
+309 FORECAST 3 3 V V A A
+310 FTEST 2 2 V A A
+311 INTERCEPT 2 2 V A A
+312 PEARSON 2 2 V A A
+313 RSQ 2 2 V A A
+314 STEYX 2 2 V A A
+315 SLOPE 2 2 V A A
+316 TTEST 4 4 V A A V V
+317 PROB 3 4 V A A V V
+318 DEVSQ 1 30 V R ...
+319 GEOMEAN 1 30 V R ...
+320 HARMEAN 1 30 V R ...
+321 SUMSQ 0 30 V R ...
+322 KURT 1 30 V R ...
+323 SKEW 1 30 V R ...
+324 ZTEST 2 3 V R V V
+325 LARGE 2 2 V R V
+326 SMALL 2 2 V R V
+327 QUARTILE 2 2 V R V
+328 PERCENTILE 2 2 V R V
+329 PERCENTRANK 2 3 V R V V
+330 MODE 1 30 V A
+331 TRIMMEAN 2 2 V R V
+332 TINV 2 2 V V V
+# New Built-In Sheet Functions in BIFF5
+70 WEEKDAY 1 2 V V V x
+101 HLOOKUP 3 4 V V R R V x
+102 VLOOKUP 3 4 V V R R V x
+220 DAYS360 2 3 V V V V x
+336 CONCATENATE 0 30 V V
+337 POWER 2 2 V V V
+342 RADIANS 1 1 V V
+343 DEGREES 1 1 V V
+344 SUBTOTAL 2 30 V V R
+345 SUMIF 2 3 V R V R
+346 COUNTIF 2 2 V R V
+347 COUNTBLANK 1 1 V R
+350 ISPMT 4 4 V V V V V
+351 DATEDIF 3 3 V V V V
+352 DATESTRING 1 1 V V
+353 NUMBERSTRING 2 2 V V V
+354 ROMAN 1 2 V V V
+# New Built-In Sheet Functions in BIFF8
+358 GETPIVOTDATA 2 30
+359 HYPERLINK 1 2 V V V
+360 PHONETIC 1 1 V R
+361 AVERAGEA 1 30 V R ...
+362 MAXA 1 30 V R ...
+363 MINA 1 30 V R ...
+364 STDEVPA 1 30 V R ...
+365 VARPA 1 30 V R ...
+366 STDEVA 1 30 V R ...
+367 VARA 1 30 V R ...
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java Sun Jun 7 15:39:51 2009
@@ -28,19 +28,14 @@
*
* @author Rainer Klute <a
* href="mailto:klute@rainer-klute.de"><klute@rainer-klute.de></a>
- * @since 2006-02-11
- * @version $Id$
*/
-public class AllDataFilesTester
-{
+public class AllDataFilesTester {
/**
* <p>Interface specifying how to run a test on a single file.</p>
*
* @author Rainer Klute <a
* href="mailto:klute@rainer-klute.de"><klute@rainer-klute.de></a>
- * @since 2006-02-11
- * @version $Id$
*/
public interface TestTask
{
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/POIFile.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/POIFile.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/POIFile.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/POIFile.java Sun Jun 7 15:39:51 2009
@@ -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,20 +14,15 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hpsf.basic;
import org.apache.poi.poifs.filesystem.POIFSDocumentPath;
-
-
/**
* <p>A POI file just for testing.</p>
*
* @author Rainer Klute (klute@rainer-klute.de)
- * @since 2002-07-20
- * @version $Id$
*/
public class POIFile
{
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestBasic.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestBasic.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestBasic.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestBasic.java Sun Jun 7 15:39:51 2009
@@ -14,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hpsf.basic;
@@ -39,14 +38,10 @@
import org.apache.poi.hpsf.SummaryInformation;
import org.apache.poi.hpsf.wellknown.SectionIDMap;
-
-
/**
* <p>Tests the basic HPSF functionality.</p>
*
* @author Rainer Klute (klute@rainer-klute.de)
- * @since 2002-07-20
- * @version $Id$
*/
public class TestBasic extends TestCase
{
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java Sun Jun 7 15:39:51 2009
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.hpsf.basic;
import java.io.ByteArrayInputStream;
@@ -42,8 +42,6 @@
*
* @author Rainer Klute <a
* href="mailto:klute@rainer-klute.de"><klute@rainer-klute.de></a>
- * @since 2003-07-25
- * @version $Id$
*/
public class TestEmptyProperties extends TestCase
{
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java Sun Jun 7 15:39:51 2009
@@ -45,8 +45,6 @@
* This class tests reading and writing of meta data. No actual document is created. All information
* is stored in a virtal document in a ByteArrayOutputStream
* @author Matthias G\u00fcnter
- * @since 2006-03-03
- * @version $Id: TestEmptyProperties.java 353563 2004-06-22 16:16:33Z klute $
*/
public class TestMetaDataIPI extends TestCase{
@@ -56,13 +54,7 @@
DocumentSummaryInformation dsi=null;
SummaryInformation si=null;
- /**
- * Standard constructor
- * @param s
- */
- public TestMetaDataIPI(String s ){
- super(s);
- }
+
/**
* Setup is used to get the document ready. Gets the DocumentSummaryInformation and the
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestReadAllFiles.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestReadAllFiles.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestReadAllFiles.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestReadAllFiles.java Sun Jun 7 15:39:51 2009
@@ -14,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hpsf.basic;
@@ -27,31 +26,14 @@
import org.apache.poi.hpsf.PropertySetFactory;
-
-
/**
* <p>Tests some HPSF functionality by reading all property sets from all files
* in the "data" directory. If you want to ensure HPSF can deal with a certain
* OLE2 file, just add it to the "data" directory and run this test case.</p>
*
* @author Rainer Klute (klute@rainer-klute.de)
- * @since 2008-02-08
- * @version $Id: TestBasic.java 489730 2006-12-22 19:18:16Z bayard $
*/
-public class TestReadAllFiles extends TestCase
-{
-
- /**
- * <p>Test case constructor.</p>
- *
- * @param name The test case's name.
- */
- public TestReadAllFiles(final String name)
- {
- super(name);
- }
-
-
+public class TestReadAllFiles extends TestCase {
/**
* <p>This test methods reads all property set streams from all POI
@@ -90,21 +72,4 @@
fail(s);
}
}
-
-
-
- /**
- * <p>Runs the test cases stand-alone.</p>
- *
- * @param args Command-line arguments (ignored)
- *
- * @exception Throwable if any sort of exception or error occurs
- */
- public static void main(final String[] args) throws Throwable
- {
- System.setProperty("HPSF.testdata.path",
- "./src/testcases/org/apache/poi/hpsf/data");
- junit.textui.TestRunner.run(TestReadAllFiles.class);
- }
-
}
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java Sun Jun 7 15:39:51 2009
@@ -14,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hpsf.basic;
@@ -34,18 +33,13 @@
import org.apache.poi.hpsf.Section;
import org.apache.poi.hpsf.SummaryInformation;
-
-
/**
* <p>Tests whether Unicode string can be read from a
* DocumentSummaryInformation.</p>
*
* @author Rainer Klute (klute@rainer-klute.de)
- * @since 2002-12-09
- * @version $Id$
*/
-public class TestUnicode extends TestCase
-{
+public class TestUnicode extends TestCase {
static final String POI_FS = "TestUnicode.xls";
static final String[] POI_FILES = new String[]
@@ -56,27 +50,13 @@
POIFile[] poiFiles;
-
- /**
- * <p>Constructor</p>
- *
- * @param name the test case's name
- */
- public TestUnicode(final String name)
- {
- super(name);
- }
-
-
-
/**
* <p>Read a the test file from the "data" directory.</p>
*
* @exception FileNotFoundException if the file to be read does not exist.
* @exception IOException if any other I/O exception occurs
*/
- protected void setUp() throws FileNotFoundException, IOException
- {
+ protected void setUp() {
final File dataDir =
new File(System.getProperty("HPSF.testdata.path"));
data = new File(dataDir, POI_FS);
@@ -112,19 +92,4 @@
Assert.assertEquals(s.getProperty(5),
"Petrovitsch, Wilhelm");
}
-
-
-
- /**
- * <p>Runs the test cases stand-alone.</p>
- *
- * @param args Command-line arguments.
- */
- public static void main(final String[] args)
- {
- System.setProperty("HPSF.testdata.path",
- "./src/testcases/org/apache/poi/hpsf/data");
- junit.textui.TestRunner.run(TestUnicode.class);
- }
-
}
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java Sun Jun 7 15:39:51 2009
@@ -64,14 +64,10 @@
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.TempFile;
-
-
/**
* <p>Tests HPSF's writing functionality.</p>
*
* @author Rainer Klute (klute@rainer-klute.de)
- * @since 2003-02-07
- * @version $Id$
*/
public class TestWrite extends TestCase
{
@@ -96,19 +92,6 @@
POIFile[] poiFiles;
-
- /**
- * <p>Constructor</p>
- *
- * @param name the test case's name
- */
- public TestWrite(final String name)
- {
- super(name);
- }
-
-
-
/**
* @see TestCase#setUp()
*/
@@ -923,20 +906,4 @@
final Charset charSet = Charset.forName(charSetName);
return charSet.newEncoder().canEncode('\u00e4');
}
-
-
-
- /**
- * <p>Runs the test cases stand-alone.</p>
- *
- * @param args The command-line parameters.
- * @throws Throwable if anything goes wrong.
- */
- public static void main(final String[] args) throws Throwable
- {
- System.setProperty("HPSF.testdata.path",
- "./src/testcases/org/apache/poi/hpsf/data");
- junit.textui.TestRunner.run(TestWrite.class);
- }
-
}
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java Sun Jun 7 15:39:51 2009
@@ -54,33 +54,17 @@
import org.apache.poi.poifs.filesystem.DocumentInputStream;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
-
-
/**
* <p>Tests HPSF's high-level writing functionality for the well-known property
* set "SummaryInformation" and "DocumentSummaryInformation".</p>
*
* @author Rainer Klute
* <a href="mailto:klute@rainer-klute.de">klute@rainer-klute.de</a>
- * @since 2006-02-01
- * @version $Id$
*/
-public class TestWriteWellKnown extends TestCase
-{
+public class TestWriteWellKnown extends TestCase {
private static final String POI_FS = "TestWriteWellKnown.doc";
- /**
- * <p>Constructor</p>
- *
- * @param name the test case's name
- */
- public TestWriteWellKnown(final String name)
- {
- super(name);
- }
-
-
/**
* @see TestCase#setUp()
@@ -744,20 +728,4 @@
assertEquals(1, cps.size());
assertFalse(cps.isPure());
}
-
-
-
- /**
- * <p>Runs the test cases stand-alone.</p>
- *
- * @param args The command-line parameters.
- * @throws Throwable if anything goes wrong.
- */
- public static void main(final String[] args) throws Throwable
- {
- System.setProperty("HPSF.testdata.path",
- "./src/testcases/org/apache/poi/hpsf/data");
- junit.textui.TestRunner.run(TestWriteWellKnown.class);
- }
-
}
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/Util.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/Util.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/Util.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hpsf/basic/Util.java Sun Jun 7 15:39:51 2009
@@ -15,7 +15,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hpsf.basic;
@@ -45,11 +44,8 @@
* <p>Static utility methods needed by the HPSF test cases.</p>
*
* @author Rainer Klute (klute@rainer-klute.de)
- * @since 2002-07-20
- * @version $Id$
*/
-public class Util
-{
+final class Util {
/**
* <p>Reads bytes from an input stream and writes them to an
@@ -261,7 +257,4 @@
System.out.println("Current directory: " +
System.getProperty("user.dir"));
}
-
-
-
}
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/data/BigSSTRecord
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/data/BigSSTRecord?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
Binary files - no diff available.
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java Sun Jun 7 15:39:51 2009
@@ -68,6 +68,7 @@
import org.apache.poi.ss.formula.FormulaParser;
import org.apache.poi.ss.formula.FormulaParserTestHelper;
import org.apache.poi.ss.usermodel.BaseTestBugzillaIssues;
+import org.apache.poi.ss.usermodel.Name;
/**
* Test the low level formula parser functionality. High level tests are to
@@ -1229,4 +1230,46 @@
assertNotNull("Ptg array should not be null", result);
confirmTokenClasses(result, new Class[] { IntPtg.class, NamePtg.class, AddPtg.class,});
}
+
+ /**
+ * Zero is not a valid row number so cell references like 'A0' are not valid.
+ * Actually, they should be treated like defined names.
+ * <br/>
+ * In addition, leading zeros (on the row component) should be removed from cell
+ * references during parsing.
+ */
+ public void testZeroRowRefs() {
+ String badCellRef = "B0"; // bad because zero is not a valid row number
+ String leadingZeroCellRef = "B000001"; // this should get parsed as "B1"
+ HSSFWorkbook wb = new HSSFWorkbook();
+
+ try {
+ HSSFFormulaParser.parse(badCellRef, wb);
+ throw new AssertionFailedError("Identified bug 47312b - Shouldn't be able to parse cell ref '"
+ + badCellRef + "'.");
+ } catch (RuntimeException e) {
+ // expected during successful test
+ FormulaParserTestHelper.confirmParseException(e, "Specified named range '"
+ + badCellRef + "' does not exist in the current workbook.");
+ }
+
+ Ptg[] ptgs;
+ try {
+ ptgs = HSSFFormulaParser.parse(leadingZeroCellRef, wb);
+ assertEquals("B1", ((RefPtg) ptgs[0]).toFormulaString());
+ } catch (RuntimeException e) {
+ FormulaParserTestHelper.confirmParseException(e, "Specified named range '"
+ + leadingZeroCellRef + "' does not exist in the current workbook.");
+ // close but no cigar
+ throw new AssertionFailedError("Identified bug 47312c - '"
+ + leadingZeroCellRef + "' should parse as 'B1'.");
+ }
+
+ // create a defined name called 'B0' and try again
+ Name n = wb.createName();
+ n.setNameName("B0");
+ n.setRefersToFormula("1+1");
+ ptgs = HSSFFormulaParser.parse("B0", wb);
+ assertEquals(NamePtg.class, ptgs[0].getClass());
+ }
}
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/model/TestSheet.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/model/TestSheet.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/model/TestSheet.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/model/TestSheet.java Sun Jun 7 15:39:51 2009
@@ -18,6 +18,7 @@
package org.apache.poi.hssf.model;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import junit.framework.AssertionFailedError;
@@ -34,6 +35,7 @@
import org.apache.poi.hssf.record.GutsRecord;
import org.apache.poi.hssf.record.IndexRecord;
import org.apache.poi.hssf.record.MergeCellsRecord;
+import org.apache.poi.hssf.record.MulBlankRecord;
import org.apache.poi.hssf.record.NumberRecord;
import org.apache.poi.hssf.record.Record;
import org.apache.poi.hssf.record.RecordBase;
@@ -613,7 +615,7 @@
try {
sheet = createSheet(inRecs);
} catch (RuntimeException e) {
- if (e.getMessage().equals("DimensionsRecord was not found")) {
+ if ("DimensionsRecord was not found".equals(e.getMessage())) {
throw new AssertionFailedError("Identified bug 46206");
}
throw e;
@@ -629,11 +631,11 @@
assertEquals(colIx, dims.getFirstCol());
assertEquals(colIx, dims.getLastCol());
}
-
+
/**
- * Prior to the fix for bug 46547, shifting formulas would have the side-effect
+ * Prior to the fix for bug 46547, shifting formulas would have the side-effect
* of creating a {@link ConditionalFormattingTable}. There was no impairment to
- * functionality since empty record aggregates are equivalent to missing record
+ * functionality since empty record aggregates are equivalent to missing record
* aggregates. However, since this unnecessary creation helped expose bug 46547b,
* and since there is a slight performance hit the fix was made to avoid it.
*/
@@ -643,14 +645,14 @@
List<RecordBase> sheetRecs = sheet.getRecords();
assertEquals(22, sheetRecs.size());
-
+
FormulaShifter shifter = FormulaShifter.createForRowShift(0, 0, 0, 1);
sheet.updateFormulasAfterCellShift(shifter, 0);
if (sheetRecs.size() == 23 && sheetRecs.get(21) instanceof ConditionalFormattingTable) {
throw new AssertionFailedError("Identified bug 46547a");
}
assertEquals(22, sheetRecs.size());
-
+
}
/**
* Bug 46547 happened when attempting to add conditional formatting to a sheet
@@ -671,4 +673,33 @@
}
assertNotNull(cft);
}
+
+ public void testCloneMulBlank_bug46776() {
+ Record[] recs = {
+ Sheet.createBOF(),
+ new DimensionsRecord(),
+ new RowRecord(1),
+ new MulBlankRecord(1, 3, new short[] { 0x0F, 0x0F, 0x0F, } ),
+ new RowRecord(2),
+ createWindow2Record(),
+ EOFRecord.instance,
+ };
+
+ Sheet sheet = createSheet(Arrays.asList(recs));
+
+ Sheet sheet2;
+ try {
+ sheet2 = sheet.cloneSheet();
+ } catch (RuntimeException e) {
+ if (e.getMessage().equals("The class org.apache.poi.hssf.record.MulBlankRecord needs to define a clone method")) {
+ throw new AssertionFailedError("Identified bug 46776");
+ }
+ throw e;
+ }
+
+ RecordCollector rc = new RecordCollector();
+ sheet2.visitContainedRecords(rc, 0);
+ Record[] clonedRecs = rc.getRecords();
+ assertEquals(recs.length+2, clonedRecs.length); // +2 for INDEX and DBCELL
+ }
}
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/record/TestCommonObjectDataSubRecord.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/record/TestCommonObjectDataSubRecord.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/record/TestCommonObjectDataSubRecord.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/record/TestCommonObjectDataSubRecord.java Sun Jun 7 15:39:51 2009
@@ -56,7 +56,7 @@
CommonObjectDataSubRecord record = new CommonObjectDataSubRecord();
record.setObjectType(CommonObjectDataSubRecord.OBJECT_TYPE_LIST_BOX);
- record.setObjectId((short) 1);
+ record.setObjectId( 1);
record.setOption((short) 1);
record.setLocked(true);
record.setPrintable(false);
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java Sun Jun 7 15:39:51 2009
@@ -83,7 +83,7 @@
ObjRecord record = new ObjRecord();
CommonObjectDataSubRecord ftCmo = new CommonObjectDataSubRecord();
ftCmo.setObjectType( CommonObjectDataSubRecord.OBJECT_TYPE_COMMENT);
- ftCmo.setObjectId( (short) 1024 );
+ ftCmo.setObjectId( 1024 );
ftCmo.setLocked( true );
ftCmo.setPrintable( true );
ftCmo.setAutofill( true );
Modified: poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java
URL: http://svn.apache.org/viewvc/poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java?rev=782402&r1=782401&r2=782402&view=diff
==============================================================================
--- poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java (original)
+++ poi/tags/REL_3_5_BETA6/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java Sun Jun 7 15:39:51 2009
@@ -17,141 +17,127 @@
package org.apache.poi.hssf.record;
+import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Iterator;
+import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.apache.poi.hssf.HSSFTestDataSamples;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.util.HexRead;
import org.apache.poi.util.LittleEndian;
/**
* @author Marc Johnson (mjohnson at apache dot org)
* @author Glen Stampoultzis (glens at apache.org)
*/
-
public final class TestSSTRecord extends TestCase {
/**
- * test processContinueRecord
+ * decodes hexdump files and concatenates the results
+ * @param hexDumpFileNames names of sample files in the hssf test data directory
+ */
+ private static byte[] concatHexDumps(String... hexDumpFileNames) {
+ int nFiles = hexDumpFileNames.length;
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(nFiles * 8228);
+ for (int i = 0; i < nFiles; i++) {
+ String sampleFileName = hexDumpFileNames[i];
+ InputStream is = HSSFTestDataSamples.openSampleFileStream(sampleFileName);
+ BufferedReader br = new BufferedReader(new InputStreamReader(is));
+ try {
+ while (true) {
+ String line = br.readLine();
+ if (line == null) {
+ break;
+ }
+ baos.write(HexRead.readFromString(line));
+ }
+ is.close();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ return baos.toByteArray();
+ }
+
+ /**
+ * @param rawData serialization of one {@link SSTRecord} and zero or more {@link ContinueRecord}s
*/
- public void testProcessContinueRecord() {
-//jmh byte[] testdata = HexRead.readData( _test_file_path + File.separator + "BigSSTRecord" );
-//jmh byte[] input = new byte[testdata.length - 4];
-//jmh
-//jmh System.arraycopy( testdata, 4, input, 0, input.length );
-//jmh SSTRecord record =
-//jmh new SSTRecord( LittleEndian.getShort( testdata, 0 ),
-//jmh LittleEndian.getShort( testdata, 2 ), input );
-//jmh byte[] continueRecord = HexRead.readData( _test_file_path + File.separator + "BigSSTRecordCR" );
-//jmh
-//jmh input = new byte[continueRecord.length - 4];
-//jmh System.arraycopy( continueRecord, 4, input, 0, input.length );
-//jmh record.processContinueRecord( input );
-//jmh assertEquals( 1464, record.getNumStrings() );
-//jmh assertEquals( 688, record.getNumUniqueStrings() );
-//jmh assertEquals( 688, record.countStrings() );
-//jmh byte[] ser_output = record.serialize();
-//jmh int offset = 0;
-//jmh short type = LittleEndian.getShort( ser_output, offset );
-//jmh
-//jmh offset += LittleEndianConsts.SHORT_SIZE;
-//jmh short length = LittleEndian.getShort( ser_output, offset );
-//jmh
-//jmh offset += LittleEndianConsts.SHORT_SIZE;
-//jmh byte[] recordData = new byte[length];
-//jmh
-//jmh System.arraycopy( ser_output, offset, recordData, 0, length );
-//jmh offset += length;
-//jmh SSTRecord testRecord = new SSTRecord( type, length, recordData );
-//jmh
-//jmh assertEquals( ContinueRecord.sid,
-//jmh LittleEndian.getShort( ser_output, offset ) );
-//jmh offset += LittleEndianConsts.SHORT_SIZE;
-//jmh length = LittleEndian.getShort( ser_output, offset );
-//jmh offset += LittleEndianConsts.SHORT_SIZE;
-//jmh byte[] cr = new byte[length];
-//jmh
-//jmh System.arraycopy( ser_output, offset, cr, 0, length );
-//jmh offset += length;
-//jmh assertEquals( offset, ser_output.length );
-//jmh testRecord.processContinueRecord( cr );
-//jmh assertEquals( record, testRecord );
-//jmh
-//jmh // testing based on new bug report
-//jmh testdata = HexRead.readData( _test_file_path + File.separator + "BigSSTRecord2" );
-//jmh input = new byte[testdata.length - 4];
-//jmh System.arraycopy( testdata, 4, input, 0, input.length );
-//jmh record = new SSTRecord( LittleEndian.getShort( testdata, 0 ),
-//jmh LittleEndian.getShort( testdata, 2 ), input );
-//jmh byte[] continueRecord1 = HexRead.readData( _test_file_path + File.separator + "BigSSTRecord2CR1" );
-//jmh
-//jmh input = new byte[continueRecord1.length - 4];
-//jmh System.arraycopy( continueRecord1, 4, input, 0, input.length );
-//jmh record.processContinueRecord( input );
-//jmh byte[] continueRecord2 = HexRead.readData( _test_file_path + File.separator + "BigSSTRecord2CR2" );
-//jmh
-//jmh input = new byte[continueRecord2.length - 4];
-//jmh System.arraycopy( continueRecord2, 4, input, 0, input.length );
-//jmh record.processContinueRecord( input );
-//jmh byte[] continueRecord3 = HexRead.readData( _test_file_path + File.separator + "BigSSTRecord2CR3" );
-//jmh
-//jmh input = new byte[continueRecord3.length - 4];
-//jmh System.arraycopy( continueRecord3, 4, input, 0, input.length );
-//jmh record.processContinueRecord( input );
-//jmh byte[] continueRecord4 = HexRead.readData( _test_file_path + File.separator + "BigSSTRecord2CR4" );
-//jmh
-//jmh input = new byte[continueRecord4.length - 4];
-//jmh System.arraycopy( continueRecord4, 4, input, 0, input.length );
-//jmh record.processContinueRecord( input );
-//jmh byte[] continueRecord5 = HexRead.readData( _test_file_path + File.separator + "BigSSTRecord2CR5" );
-//jmh
-//jmh input = new byte[continueRecord5.length - 4];
-//jmh System.arraycopy( continueRecord5, 4, input, 0, input.length );
-//jmh record.processContinueRecord( input );
-//jmh byte[] continueRecord6 = HexRead.readData( _test_file_path + File.separator + "BigSSTRecord2CR6" );
-//jmh
-//jmh input = new byte[continueRecord6.length - 4];
-//jmh System.arraycopy( continueRecord6, 4, input, 0, input.length );
-//jmh record.processContinueRecord( input );
-//jmh byte[] continueRecord7 = HexRead.readData( _test_file_path + File.separator + "BigSSTRecord2CR7" );
-//jmh
-//jmh input = new byte[continueRecord7.length - 4];
-//jmh System.arraycopy( continueRecord7, 4, input, 0, input.length );
-//jmh record.processContinueRecord( input );
-//jmh assertEquals( 158642, record.getNumStrings() );
-//jmh assertEquals( 5249, record.getNumUniqueStrings() );
-//jmh assertEquals( 5249, record.countStrings() );
-//jmh ser_output = record.serialize();
-//jmh offset = 0;
-//jmh type = LittleEndian.getShort( ser_output, offset );
-//jmh offset += LittleEndianConsts.SHORT_SIZE;
-//jmh length = LittleEndian.getShort( ser_output, offset );
-//jmh offset += LittleEndianConsts.SHORT_SIZE;
-//jmh recordData = new byte[length];
-//jmh System.arraycopy( ser_output, offset, recordData, 0, length );
-//jmh offset += length;
-//jmh testRecord = new SSTRecord( type, length, recordData );
-//jmh for ( int count = 0; count < 7; count++ )
-//jmh {
-//jmh assertEquals( ContinueRecord.sid,
-//jmh LittleEndian.getShort( ser_output, offset ) );
-//jmh offset += LittleEndianConsts.SHORT_SIZE;
-//jmh length = LittleEndian.getShort( ser_output, offset );
-//jmh offset += LittleEndianConsts.SHORT_SIZE;
-//jmh cr = new byte[length];
-//jmh System.arraycopy( ser_output, offset, cr, 0, length );
-//jmh testRecord.processContinueRecord( cr );
-//jmh offset += length;
-//jmh }
-//jmh assertEquals( offset, ser_output.length );
-//jmh assertEquals( record, testRecord );
-//jmh assertEquals( record.countStrings(), testRecord.countStrings() );
+ private static SSTRecord createSSTFromRawData(byte[] rawData) {
+ RecordInputStream in = new RecordInputStream(new ByteArrayInputStream(rawData));
+ in.nextRecord();
+ SSTRecord result = new SSTRecord(in);
+ assertEquals(0, in.remaining());
+ assertTrue(!in.hasNextRecord());
+ return result;
+ }
+
+ /**
+ * SST is often split over several {@link ContinueRecord}s
+ */
+ public void testContinuedRecord() {
+ byte[] origData;
+ SSTRecord record;
+ byte[] ser_output;
+
+ origData = concatHexDumps("BigSSTRecord", "BigSSTRecordCR");
+ record = createSSTFromRawData(origData);
+ assertEquals( 1464, record.getNumStrings() );
+ assertEquals( 688, record.getNumUniqueStrings() );
+ assertEquals( 688, record.countStrings() );
+ ser_output = record.serialize();
+ assertTrue(Arrays.equals(origData, ser_output));
+
+ // testing based on new bug report
+ origData = concatHexDumps("BigSSTRecord2", "BigSSTRecord2CR1", "BigSSTRecord2CR2", "BigSSTRecord2CR3",
+ "BigSSTRecord2CR4", "BigSSTRecord2CR5", "BigSSTRecord2CR6", "BigSSTRecord2CR7");
+ record = createSSTFromRawData(origData);
+
+
+ assertEquals( 158642, record.getNumStrings() );
+ assertEquals( 5249, record.getNumUniqueStrings() );
+ assertEquals( 5249, record.countStrings() );
+ ser_output = record.serialize();
+ if (false) { // set true to observe make sure areSameSSTs() is working
+ ser_output[11000] = 'X';
+ }
+
+ SSTRecord rec2 = createSSTFromRawData(ser_output);
+ if (!areSameSSTs(record, rec2)) {
+ throw new AssertionFailedError("large SST re-serialized incorrectly");
+ }
+ if (false) {
+ // TODO - trivial differences in ContinueRecord break locations
+ // Sample data should be checked against what most recent Excel version produces.
+ // maybe tweaks are required in ContinuableRecordOutput
+ assertTrue(Arrays.equals(origData, ser_output));
+ }
+ }
+
+ private boolean areSameSSTs(SSTRecord a, SSTRecord b) {
+
+ if (a.getNumStrings() != b.getNumStrings()) {
+ return false;
+ }
+ int nElems = a.getNumUniqueStrings();
+ if (nElems != b.getNumUniqueStrings()) {
+ return false;
+ }
+ for(int i=0; i<nElems; i++) {
+ if (!a.getString(i).equals(b.getString(i))) {
+ return false;
+ }
+ }
+ return true;
}
/**
@@ -277,8 +263,7 @@
/**
* test simple addString
*/
- public void testSimpleAddString()
- {
+ public void testSimpleAddString() {
SSTRecord record = new SSTRecord();
UnicodeString s1 = new UnicodeString("Hello world");
@@ -324,9 +309,7 @@
/**
* test simple constructor
*/
-
- public void testSimpleConstructor()
- {
+ public void testSimpleConstructor() {
SSTRecord record = new SSTRecord();
assertEquals( 0, record.getNumStrings() );
@@ -348,28 +331,15 @@
}
/**
- * main method to run the unit tests
- *
- * @param ignored_args
- */
-
- public static void main( String[] ignored_args ) {
- junit.textui.TestRunner.run( TestSSTRecord.class );
- }
-
- /**
* Tests that workbooks with rich text that duplicates a non rich text cell can be read and written.
*/
- public void testReadWriteDuplicatedRichText1()
- throws Exception
- {
+ public void testReadWriteDuplicatedRichText1() {
HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("duprich1.xls");
HSSFSheet sheet = wb.getSheetAt( 1 );
assertEquals( "01/05 (Wed)", sheet.getRow( 0 ).getCell(8 ).getStringCellValue() );
assertEquals( "01/05 (Wed)", sheet.getRow( 1 ).getCell(8 ).getStringCellValue() );
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- wb.write( baos );
+ HSSFTestDataSamples.writeOutAndReadBack(wb);
// test the second file.
wb = HSSFTestDataSamples.openSampleWorkbook("duprich2.xls");
@@ -382,6 +352,6 @@
assertEquals( "Testing", sheet.getRow( row++ ).getCell(0 ).getStringCellValue() );
assertEquals( "Testing", sheet.getRow( row++ ).getCell(0 ).getStringCellValue() );
- wb.write( baos );
+ HSSFTestDataSamples.writeOutAndReadBack(wb);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org