Refactor to reduce clutter
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1613374 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
29e5928c42
commit
0dde805ec7
@ -30,7 +30,6 @@ import org.apache.poi.ss.formula.FormulaParseException;
|
|||||||
import org.apache.poi.ss.formula.FormulaParsingWorkbook;
|
import org.apache.poi.ss.formula.FormulaParsingWorkbook;
|
||||||
import org.apache.poi.ss.formula.FormulaRenderingWorkbook;
|
import org.apache.poi.ss.formula.FormulaRenderingWorkbook;
|
||||||
import org.apache.poi.ss.formula.FormulaType;
|
import org.apache.poi.ss.formula.FormulaType;
|
||||||
import org.apache.poi.ss.formula.NameIdentifier;
|
|
||||||
import org.apache.poi.ss.formula.SheetIdentifier;
|
import org.apache.poi.ss.formula.SheetIdentifier;
|
||||||
import org.apache.poi.ss.formula.SheetRangeIdentifier;
|
import org.apache.poi.ss.formula.SheetRangeIdentifier;
|
||||||
import org.apache.poi.ss.formula.ptg.Area3DPtg;
|
import org.apache.poi.ss.formula.ptg.Area3DPtg;
|
||||||
@ -71,24 +70,6 @@ public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E
|
|||||||
public int getExternalSheetIndex(String workbookName, String sheetName) {
|
public int getExternalSheetIndex(String workbookName, String sheetName) {
|
||||||
return _iBook.getExternalSheetIndex(workbookName, sheetName);
|
return _iBook.getExternalSheetIndex(workbookName, sheetName);
|
||||||
}
|
}
|
||||||
public int getExternalSheetIndex(String workbookName, String firstSheetName, String lastSheetName) {
|
|
||||||
return _iBook.getExternalSheetIndex(workbookName, firstSheetName, lastSheetName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getExternalSheetIndex(String workbookName, NameIdentifier sheetName) {
|
|
||||||
return getExternalSheetIndex(workbookName, sheetName.getName());
|
|
||||||
}
|
|
||||||
public int getExternalSheetIndex(String workbookName, NameIdentifier firstSheetName, NameIdentifier lastSheetName) {
|
|
||||||
return getExternalSheetIndex(workbookName, firstSheetName.getName(), lastSheetName.getName());
|
|
||||||
}
|
|
||||||
public int getExternalSheetIndex(NameIdentifier sheetName) {
|
|
||||||
return getExternalSheetIndex(sheetName.getName());
|
|
||||||
}
|
|
||||||
public int getExternalSheetIndex(NameIdentifier firstSheetName, NameIdentifier lastSheetName) {
|
|
||||||
int firstSheetIndex = _uBook.getSheetIndex(firstSheetName.getName());
|
|
||||||
int lastSheetIndex = _uBook.getSheetIndex(lastSheetName.getName());
|
|
||||||
return _iBook.checkExternSheet(firstSheetIndex, lastSheetIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Ptg get3DReferencePtg(CellReference cr, SheetIdentifier sheet) {
|
public Ptg get3DReferencePtg(CellReference cr, SheetIdentifier sheet) {
|
||||||
int extIx = getSheetExtIx(sheet);
|
int extIx = getSheetExtIx(sheet);
|
||||||
@ -255,25 +236,20 @@ public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E
|
|||||||
if (sheetIden == null) {
|
if (sheetIden == null) {
|
||||||
extIx = -1;
|
extIx = -1;
|
||||||
} else {
|
} else {
|
||||||
NameIdentifier sheetName = sheetIden.getSheetIdentifier();
|
String workbookName = sheetIden.getBookName();
|
||||||
NameIdentifier lastSheetName = null;
|
String firstSheetName = sheetIden.getSheetIdentifier().getName();
|
||||||
|
String lastSheetName = firstSheetName;
|
||||||
|
|
||||||
if (sheetIden instanceof SheetRangeIdentifier) {
|
if (sheetIden instanceof SheetRangeIdentifier) {
|
||||||
lastSheetName = ((SheetRangeIdentifier)sheetIden).getLastSheetIdentifier();
|
lastSheetName = ((SheetRangeIdentifier)sheetIden).getLastSheetIdentifier().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sheetIden.getBookName() == null) {
|
if (workbookName == null) {
|
||||||
if (lastSheetName == null) {
|
int firstSheetIndex = _uBook.getSheetIndex(firstSheetName);
|
||||||
extIx = getExternalSheetIndex(sheetName);
|
int lastSheetIndex = _uBook.getSheetIndex(lastSheetName);
|
||||||
|
extIx = _iBook.checkExternSheet(firstSheetIndex, lastSheetIndex);
|
||||||
} else {
|
} else {
|
||||||
extIx = getExternalSheetIndex(sheetName, lastSheetName);
|
extIx = _iBook.getExternalSheetIndex(workbookName, firstSheetName, lastSheetName);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (lastSheetName == null) {
|
|
||||||
extIx = getExternalSheetIndex(sheetIden.getBookName(), sheetName);
|
|
||||||
} else {
|
|
||||||
extIx = getExternalSheetIndex(sheetIden.getBookName(), sheetName, lastSheetName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return extIx;
|
return extIx;
|
||||||
|
Loading…
Reference in New Issue
Block a user