|
|
@@ -302,6 +302,9 @@ class CellExpressionSet {
|
|
302
|
302
|
|
|
303
|
303
|
case CellExpressionOperation::Reference: {
|
|
304
|
304
|
$refAddress = $expr->arguments[0];
|
|
|
305
|
+ if ($refAddress === null) {
|
|
|
306
|
+ throw new CellEvaluationException("Invalid cell address", '#REF');
|
|
|
307
|
+ }
|
|
305
|
308
|
$cell = $this->grid->cellAt($refAddress);
|
|
306
|
309
|
if ($cell === null) {
|
|
307
|
310
|
throw new CellEvaluationException("No cell at {$refAddress->name}", '#REF');
|
|
|
@@ -1394,7 +1397,7 @@ class CellExpression {
|
|
1394
|
1397
|
$exp = self::tryExpression($tokens, $start, $end - 1, $address);
|
|
1395
|
1398
|
$columnIndex = $address->columnIndex;
|
|
1396
|
1399
|
$exp->fillRanges = [
|
|
1397
|
|
- new CellAddressRange(new CellAddress($columnIndex, -1), new CellAddress($columnIndex, -1)),
|
|
|
1400
|
+ new CellAddressRange(new CellAddress($columnIndex, $address->rowIndex), new CellAddress($columnIndex, 999999)),
|
|
1398
|
1401
|
];
|
|
1399
|
1402
|
return $exp;
|
|
1400
|
1403
|
}
|
|
|
@@ -1624,6 +1627,7 @@ class CellExpression {
|
|
1624
|
1627
|
if (!$tokens[$start]->type->isPotentialAddress()) return null;
|
|
1625
|
1628
|
$ref = mb_strtoupper($tokens[$start]->content);
|
|
1626
|
1629
|
$refAddress = CellAddress::fromString($ref, $address, true);
|
|
|
1630
|
+ if ($refAddress === null) return null;
|
|
1627
|
1631
|
return new CellExpression(CellExpressionOperation::Reference, [ $refAddress ]);
|
|
1628
|
1632
|
}
|
|
1629
|
1633
|
|