INDIRECT and OFFSET call to get worksheet rather than cell collection

This commit is contained in:
Mark Baker 2013-07-11 08:28:42 +01:00
parent 509bfd39e2
commit d62615fbeb
2 changed files with 7 additions and 7 deletions

View File

@ -316,9 +316,9 @@ class PHPExcel_Calculation_LookupRef {
if (strpos($cellAddress,'!') !== FALSE) {
list($sheetName, $cellAddress) = explode('!',$cellAddress);
$sheetName = trim($sheetName, "'");
$pSheet = $pCell->getParent()->getParent()->getSheetByName($sheetName);
$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
} else {
$pSheet = $pCell->getParent();
$pSheet = $pCell->getWorksheet();
}
return PHPExcel_Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, FALSE);
@ -327,9 +327,9 @@ class PHPExcel_Calculation_LookupRef {
if (strpos($cellAddress,'!') !== FALSE) {
list($sheetName,$cellAddress) = explode('!',$cellAddress);
$sheetName = trim($sheetName, "'");
$pSheet = $pCell->getParent()->getParent()->getSheetByName($sheetName);
$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
} else {
$pSheet = $pCell->getParent();
$pSheet = $pCell->getWorksheet();
}
return PHPExcel_Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, FALSE);
@ -421,9 +421,9 @@ class PHPExcel_Calculation_LookupRef {
}
if ($sheetName !== NULL) {
$pSheet = $pCell->getParent()->getParent()->getSheetByName($sheetName);
$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
} else {
$pSheet = $pCell->getParent();
$pSheet = $pCell->getWorksheet();
}
return PHPExcel_Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, False);

View File

@ -469,7 +469,7 @@ class PHPExcel_Cell
/**
* Get parent worksheet
*
* @return PHPExcel_Worksheet
* @return PHPExcel_CachedObjectStorage_CacheBase
*/
public function getParent() {
return $this->_parent;