From d62615fbeb80d0021c849645826162f911ead77a Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Thu, 11 Jul 2013 08:28:42 +0100 Subject: [PATCH] INDIRECT and OFFSET call to get worksheet rather than cell collection --- Classes/PHPExcel/Calculation/LookupRef.php | 12 ++++++------ Classes/PHPExcel/Cell.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Classes/PHPExcel/Calculation/LookupRef.php b/Classes/PHPExcel/Calculation/LookupRef.php index c3363f1..96c7da2 100644 --- a/Classes/PHPExcel/Calculation/LookupRef.php +++ b/Classes/PHPExcel/Calculation/LookupRef.php @@ -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); diff --git a/Classes/PHPExcel/Cell.php b/Classes/PHPExcel/Cell.php index 6664e64..2cafff3 100644 --- a/Classes/PHPExcel/Cell.php +++ b/Classes/PHPExcel/Cell.php @@ -469,7 +469,7 @@ class PHPExcel_Cell /** * Get parent worksheet * - * @return PHPExcel_Worksheet + * @return PHPExcel_CachedObjectStorage_CacheBase */ public function getParent() { return $this->_parent;