poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1613455 - in /poi/trunk/src: java/org/apache/poi/ss/formula/OperationEvaluationContext.java ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
Date Fri, 25 Jul 2014 15:55:50 GMT
Author: nick
Date: Fri Jul 25 15:55:49 2014
New Revision: 1613455

URL: http://svn.apache.org/r1613455
Log:
Allow XSSF to evaluate multi-sheet references too, for #55906

Modified:
    poi/trunk/src/java/org/apache/poi/ss/formula/OperationEvaluationContext.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/OperationEvaluationContext.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/OperationEvaluationContext.java?rev=1613455&r1=1613454&r2=1613455&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/OperationEvaluationContext.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/OperationEvaluationContext.java Fri Jul 25
15:55:49 2014
@@ -79,8 +79,8 @@ public final class OperationEvaluationCo
 	SheetRangeEvaluator createExternSheetRefEvaluator(ExternSheetReferenceToken ptg) {
 		return createExternSheetRefEvaluator(ptg.getExternSheetIndex());
 	}
-	SheetRangeEvaluator createExternSheetRefEvaluator(String sheetName, int externalWorkbookNumber)
{
-        ExternalSheet externalSheet = _workbook.getExternalSheet(sheetName, null, externalWorkbookNumber);
+	SheetRangeEvaluator createExternSheetRefEvaluator(String firstSheetName, String lastSheetName,
int externalWorkbookNumber) {
+        ExternalSheet externalSheet = _workbook.getExternalSheet(firstSheetName, lastSheetName,
externalWorkbookNumber);
         return createExternSheetRefEvaluator(externalSheet);
     }
 	SheetRangeEvaluator createExternSheetRefEvaluator(int externSheetIndex) {
@@ -306,7 +306,8 @@ public final class OperationEvaluationCo
 		return new LazyRefEval(rptg.getRow(), rptg.getColumn(), sre);
 	}
     public ValueEval getRef3DEval(Ref3DPxg rptg) {
-        SheetRangeEvaluator sre = createExternSheetRefEvaluator(rptg.getSheetName(), rptg.getExternalWorkbookNumber());
+        SheetRangeEvaluator sre = createExternSheetRefEvaluator(
+                rptg.getSheetName(), rptg.getLastSheetName(), rptg.getExternalWorkbookNumber());
         return new LazyRefEval(rptg.getRow(), rptg.getColumn(), sre);
     }
     
@@ -321,7 +322,8 @@ public final class OperationEvaluationCo
                 aptg.getLastRow(), aptg.getLastColumn(), sre);
     }
     public ValueEval getArea3DEval(Area3DPxg aptg) {
-        SheetRangeEvaluator sre = createExternSheetRefEvaluator(aptg.getSheetName(), aptg.getExternalWorkbookNumber());
+        SheetRangeEvaluator sre = createExternSheetRefEvaluator(
+                aptg.getSheetName(), aptg.getLastSheetName(), aptg.getExternalWorkbookNumber());
         return new LazyAreaEval(aptg.getFirstRow(), aptg.getFirstColumn(),
                 aptg.getLastRow(), aptg.getLastColumn(), sre);
     }

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java?rev=1613455&r1=1613454&r2=1613455&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
(original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
Fri Jul 25 15:55:49 2014
@@ -184,10 +184,8 @@ public final class TestXSSFFormulaEvalua
      *  Sheets 1 through Sheet 3).
      * This test, based on common test files for HSSF and XSSF, checks
      *  that we can correctly evaluate these
-     *  
-     * TODO Fix this to pass for XSSF too, currently only passes for HSSF...
      */
-    public void DISABLEDtestMultiSheetReferencesHSSFandXSSF() throws Exception {
+    public void testMultiSheetReferencesHSSFandXSSF() throws Exception {
         Workbook[] wbs = new Workbook[] {
                 HSSFTestDataSamples.openSampleWorkbook("55906-MultiSheetRefs.xls"),
                 XSSFTestDataSamples.openSampleWorkbook("55906-MultiSheetRefs.xlsx")



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message