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

View File

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