public NameXPxg getNameXPtg(String name, SheetIdentifier sheet) {
// First, try to find it as a User Defined Function
IndexedUDFFinder udfFinder = (IndexedUDFFinder)getUDFFinder();
FreeRefFunction func = udfFinder.findFunction(name);
if (func != null) {
return new NameXPxg(null, name);
}
// Otherwise, try it as a named range
if (sheet == null) {
if (_uBook.getNameIndex(name) > -1) {
return new NameXPxg(null, name);
}
return null;
}
if (sheet._sheetIdentifier == null) {
// Workbook + Named Range only
int bookIndex = resolveBookIndex(sheet._bookName);
return new NameXPxg(bookIndex, null, name);
}
// Use the sheetname and process
String sheetName = sheet._sheetIdentifier.getName();
if (sheet._bookName != null) {
int bookIndex = resolveBookIndex(sheet._bookName);
return new NameXPxg(bookIndex, sheetName, name);
} else {
return new NameXPxg(sheetName, name);
}
}