From e80c3aabc168c58fe2f8cc164e55fbc1317a38f2 Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Sat, 2 Mar 2013 11:38:09 +0000 Subject: [PATCH] Bugzilla 54436: Fixed metadata for GETPIVOTDATA function git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1451875 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/usermodel/TestXSSFBugs.java | 17 +++++++++++++++++ .../ss/formula/function/functionMetadata.txt | 14 +++++++------- test-data/spreadsheet/54436.xlsx | Bin 0 -> 12180 bytes 3 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 test-data/spreadsheet/54436.xlsx 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 4c55cca90..76e7a36e9 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 277d229a8..36775c859 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 new file mode 100644 index 0000000000000000000000000000000000000000..4f113b8b717e097d35fcb8e917081ef7a67d49e9 GIT binary patch literal 12180 zcmeHtWmH_-vUTI`8r3l`jhyM3M9b1&y`&ilsu z|L$gV(|dQ<9KB~(t*Tk86lB1_(E*SEXaE2}3^-HmnQ8_B02HAB05kwJsJ4imt+R=( zv!2R3dlM&J26r24qC9X=svH0)@bmvY{tq+oMO99Ioe8;>^n{Q^Pd#do09lKDb4)kd zH~ADy$74am#d?r6@p9#;hhA4DNj%72Ds%2^Ipf4L(snkARxNf6QZKC3kqY*h2YVkY z$vtZs!B*6-phc0v{bLWL!uM!KM)65GaJsn#BXY~UYZ>V&b~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