diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dc40f8a..b8aa5771 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org). This functionality is locale-aware, using the server's locale settings to identify the thousands and decimal separators. - Support for two cell anchor drawing of images. [#2532](https://github.com/PHPOffice/PhpSpreadsheet/pull/2532) +- Limited support for Xls Reader to handle Conditional Formatting: + + Ranges and Rules are read, but style is currently limited to font size, weight and color. ### Changed diff --git a/src/PhpSpreadsheet/Reader/Xls.php b/src/PhpSpreadsheet/Reader/Xls.php index 5e287472..0b2d17a8 100644 --- a/src/PhpSpreadsheet/Reader/Xls.php +++ b/src/PhpSpreadsheet/Reader/Xls.php @@ -7,7 +7,6 @@ use PhpOffice\PhpSpreadsheet\Cell\DataType; use PhpOffice\PhpSpreadsheet\Cell\DataValidation; use PhpOffice\PhpSpreadsheet\Exception as PhpSpreadsheetException; use PhpOffice\PhpSpreadsheet\NamedRange; -use PhpOffice\PhpSpreadsheet\Reader\Xls\Color; use PhpOffice\PhpSpreadsheet\Reader\Xls\ConditionalFormatting; use PhpOffice\PhpSpreadsheet\Reader\Xls\Style\CellFont; use PhpOffice\PhpSpreadsheet\RichText\RichText; @@ -8069,14 +8068,13 @@ class Xls extends BaseReader $style->getFont()->setSize($fontSize / 20); // Convert twips to points } - $bold = self::getUInt2d($options, 72) === 700; // 400 = normal, 700 = bold $style->getFont()->setBold($bold); $color = self::getInt4d($options, 80); if ($color !== -1) { - $style->getFont()->getColor()->setRGB(Color::map($color, $this->palette, $this->version)['rgb']); + $style->getFont()->getColor()->setRGB(Xls\Color::map($color, $this->palette, $this->version)['rgb']); } } diff --git a/tests/data/Reader/XLS/CF_Expression_Comparisons.xls b/tests/data/Reader/XLS/CF_Expression_Comparisons.xls index 34487aa8..c9c8fe42 100644 Binary files a/tests/data/Reader/XLS/CF_Expression_Comparisons.xls and b/tests/data/Reader/XLS/CF_Expression_Comparisons.xls differ