Skip to content

Commit

Permalink
updates to Calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
edlouth committed May 20, 2020
1 parent be415fa commit c994f6d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/PhpSpreadsheet/Calculation/Calculation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4163,7 +4163,16 @@ private function processTokenStack($tokens, $cellID = null, ?Cell $pCell = null)
}
$this->debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in worksheet ', $matches[2]);
if ($pCellParent !== null) {
$cellSheet = $this->spreadsheet->getSheetByName($matches[2]);
$worksheets = $this->spreadsheet->getAllSheets();

$worksheetCount = count($worksheets);
for ($i = 0; $i < $worksheetCount; ++$i) {
if ($worksheets[$i]->getTitle() === trim($pName, "'")) {
$cellSheet = $worksheets[$i];
}
}

// $cellSheet = $this->spreadsheet->getSheetByName($matches[2]);
if ($cellSheet && $cellSheet->cellExists($cellRef)) {
$cellValue = $this->extractCellRange($cellRef, $this->spreadsheet->getSheetByName($matches[2]), false);
$pCell->attach($pCellParent);
Expand Down

0 comments on commit c994f6d

Please sign in to comment.