From 2484a03f19950a923490f391b7e3678c15a69b1f Mon Sep 17 00:00:00 2001 From: DCoderLT Date: Thu, 28 Apr 2016 07:32:19 +0300 Subject: [PATCH] Fix fatal error when `RichText` extract container cell's font `RichText` tries to extract container cell's font via `Cell->getParent()->getStyle(...)`, which crashes because `getParent()` does not return a worksheet. Changing it to `getWorksheet()` fixes the problem. --- src/PhpSpreadsheet/RichText.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpSpreadsheet/RichText.php b/src/PhpSpreadsheet/RichText.php index 5e77b2b1..7076b1b2 100644 --- a/src/PhpSpreadsheet/RichText.php +++ b/src/PhpSpreadsheet/RichText.php @@ -48,7 +48,7 @@ class RichText implements IComparable // Add cell text and style if ($pCell->getValue() != '') { $objRun = new RichText\Run($pCell->getValue()); - $objRun->setFont(clone $pCell->getParent()->getStyle($pCell->getCoordinate())->getFont()); + $objRun->setFont(clone $pCell->getWorksheet()->getStyle($pCell->getCoordinate())->getFont()); $this->addText($objRun); }