diff options
author | Yegor Kozlov <yegor@apache.org> | 2013-03-02 11:38:09 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2013-03-02 11:38:09 +0000 |
commit | 38774b82a807e0155926405aed9cac7a0d14fc8b (patch) | |
tree | f542b64273f4d578e977c38ca49f1d544cc41640 | |
parent | 22f30ab168078817aca145c9a3105b9ba5a9db2a (diff) | |
download | poi-38774b82a807e0155926405aed9cac7a0d14fc8b.tar.gz poi-38774b82a807e0155926405aed9cac7a0d14fc8b.zip |
Bugzilla 54436: Fixed metadata for GETPIVOTDATA function
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1451875 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java | 17 | ||||
-rw-r--r-- | src/resources/main/org/apache/poi/ss/formula/function/functionMetadata.txt | 14 | ||||
-rw-r--r-- | test-data/spreadsheet/54436.xlsx | bin | 0 -> 12180 bytes |
3 files changed, 24 insertions, 7 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index 4c55cca900..76e7a36e98 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -26,6 +26,10 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackagingURIHelper; +import org.apache.poi.ss.formula.WorkbookEvaluator; +import org.apache.poi.ss.formula.eval.ErrorEval; +import org.apache.poi.ss.formula.eval.ValueEval; +import org.apache.poi.ss.formula.functions.Function; import org.apache.poi.ss.usermodel.BaseTestBugzillaIssues; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; @@ -1339,4 +1343,17 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { assertEquals(259.0, a1Value, 0.0); } + public void test54436(){ + Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("54436.xlsx"); + if(!WorkbookEvaluator.getSupportedFunctionNames().contains("GETPIVOTDATA")){ + Function func = new Function() { + public ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) { + return ErrorEval.NA; + } + }; + + WorkbookEvaluator.registerFunction("GETPIVOTDATA", func); + } + workbook.getCreationHelper().createFormulaEvaluator().evaluateAll(); + } } diff --git a/src/resources/main/org/apache/poi/ss/formula/function/functionMetadata.txt b/src/resources/main/org/apache/poi/ss/formula/function/functionMetadata.txt index 277d229a82..36775c859d 100644 --- a/src/resources/main/org/apache/poi/ss/formula/function/functionMetadata.txt +++ b/src/resources/main/org/apache/poi/ss/formula/function/functionMetadata.txt @@ -271,13 +271,13 @@ 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 ... +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 V V R ...
+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 ... diff --git a/test-data/spreadsheet/54436.xlsx b/test-data/spreadsheet/54436.xlsx Binary files differnew file mode 100644 index 0000000000..4f113b8b71 --- /dev/null +++ b/test-data/spreadsheet/54436.xlsx |