Load with styles should not default to black fill color

Fixes #1353
Closes #1361
This commit is contained in:
bbinotto 2020-02-14 14:32:41 +01:00 committed by Adrien Crivelli
parent a6c56d0f81
commit e2f87e8b7a
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
3 changed files with 3 additions and 4 deletions

View File

@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
- Fix loading styles from vmlDrawings when containing whitespace [#1347](https://github.com/PHPOffice/PhpSpreadsheet/issues/1347) - Fix loading styles from vmlDrawings when containing whitespace [#1347](https://github.com/PHPOffice/PhpSpreadsheet/issues/1347)
- Fix incorrect behavior when removing last row [#1365](https://github.com/PHPOffice/PhpSpreadsheet/pull/1365) - Fix incorrect behavior when removing last row [#1365](https://github.com/PHPOffice/PhpSpreadsheet/pull/1365)
- MATCH with a static array should return the position of the found value based on the values submitted [#1332](https://github.com/PHPOffice/PhpSpreadsheet/pull/1332) - MATCH with a static array should return the position of the found value based on the values submitted [#1332](https://github.com/PHPOffice/PhpSpreadsheet/pull/1332)
- Fix Xlsx Reader's handling of undefined fill color [#1353](https://github.com/PHPOffice/PhpSpreadsheet/pull/1353)
## [1.11.0] - 2020-03-02 ## [1.11.0] - 2020-03-02

View File

@ -1620,8 +1620,6 @@ class Xlsx extends BaseReader
$docStyle->getFill()->setFillType($patternType); $docStyle->getFill()->setFillType($patternType);
if ($style->fill->patternFill->fgColor) { if ($style->fill->patternFill->fgColor) {
$docStyle->getFill()->getStartColor()->setARGB(self::readColor($style->fill->patternFill->fgColor, true)); $docStyle->getFill()->getStartColor()->setARGB(self::readColor($style->fill->patternFill->fgColor, true));
} else {
$docStyle->getFill()->getStartColor()->setARGB('FF000000');
} }
if ($style->fill->patternFill->bgColor) { if ($style->fill->patternFill->bgColor) {
$docStyle->getFill()->getEndColor()->setARGB(self::readColor($style->fill->patternFill->bgColor, true)); $docStyle->getFill()->getEndColor()->setARGB(self::readColor($style->fill->patternFill->bgColor, true));

View File

@ -83,8 +83,8 @@ class XlsxTest extends TestCase
{ {
$expectedColours = [ $expectedColours = [
1 => ['A' => 'C00000', 'C' => 'FF0000', 'E' => 'FFC000'], 1 => ['A' => 'C00000', 'C' => 'FF0000', 'E' => 'FFC000'],
3 => ['A' => '7030A0', 'C' => '000000', 'E' => 'FFFF00'], 3 => ['A' => '7030A0', 'C' => 'FFFFFF', 'E' => 'FFFF00'],
5 => ['A' => '002060', 'C' => '000000', 'E' => '92D050'], 5 => ['A' => '002060', 'C' => 'FFFFFF', 'E' => '92D050'],
7 => ['A' => '0070C0', 'C' => '00B0F0', 'E' => '00B050'], 7 => ['A' => '0070C0', 'C' => '00B0F0', 'E' => '00B050'],
]; ];