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.
This commit is contained in:
DCoderLT 2016-04-28 07:32:19 +03:00 committed by Adrien Crivelli
parent 720fb3eff5
commit 2484a03f19
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class RichText implements IComparable
// Add cell text and style // Add cell text and style
if ($pCell->getValue() != '') { if ($pCell->getValue() != '') {
$objRun = new RichText\Run($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); $this->addText($objRun);
} }