Skip to content

Commit

Permalink
Fix issue with richtext color values not being read in Xlsx.php (prob…
Browse files Browse the repository at this point in the history
…ably related to a namespace change and - according to commit log - issue PHPOffice#2303)

Use SimpleXMLElement::count() instead of the native count function to avoid code style issues.
  • Loading branch information
daedeloth committed Dec 21, 2021
1 parent 8ceaae8 commit 2d1b9ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Reader/Xlsx.php
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ private function parseRichText(?SimpleXMLElement $is)
$objText->getFont()->setSize((float) $attr['val']);
}
$attr = $run->rPr->color->attributes();
if (count($attr) > 0) {
if ($attr && $attr->count() > 0) {
$objText->getFont()->setColor(new Color($this->styleReader->readColor($attr)));
}
if (isset($run->rPr->b)) {
Expand Down

0 comments on commit 2d1b9ab

Please sign in to comment.