Allow XSSF to evaluate multi-sheet references too, for #55906
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1613455 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
82b36d3268
commit
97c4bbc9b8
@ -79,8 +79,8 @@ public final class OperationEvaluationContext {
|
||||
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 OperationEvaluationContext {
|
||||
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 OperationEvaluationContext {
|
||||
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);
|
||||
}
|
||||
|
@ -184,10 +184,8 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator {
|
||||
* 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")
|
||||
|
Loading…
Reference in New Issue
Block a user