|
9 | 9 | use PhpOffice\PhpSpreadsheet\NamedRange;
|
10 | 10 | use PhpOffice\PhpSpreadsheet\Reader\Xls\ConditionalFormatting;
|
11 | 11 | use PhpOffice\PhpSpreadsheet\Reader\Xls\Style\CellFont;
|
| 12 | +use PhpOffice\PhpSpreadsheet\Reader\Xls\Style\FillPattern; |
12 | 13 | use PhpOffice\PhpSpreadsheet\RichText\RichText;
|
13 | 14 | use PhpOffice\PhpSpreadsheet\Shared\CodePage;
|
14 | 15 | use PhpOffice\PhpSpreadsheet\Shared\Date;
|
|
23 | 24 | use PhpOffice\PhpSpreadsheet\Style\Alignment;
|
24 | 25 | use PhpOffice\PhpSpreadsheet\Style\Borders;
|
25 | 26 | use PhpOffice\PhpSpreadsheet\Style\Conditional;
|
| 27 | +use PhpOffice\PhpSpreadsheet\Style\Fill; |
26 | 28 | use PhpOffice\PhpSpreadsheet\Style\Font;
|
27 | 29 | use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
28 | 30 | use PhpOffice\PhpSpreadsheet\Style\Protection;
|
@@ -8013,6 +8015,25 @@ private function getCFBorderStyle(string $options, Style $style): void
|
8013 | 8015 |
|
8014 | 8016 | private function getCFFillStyle(string $options, Style $style): void
|
8015 | 8017 | {
|
| 8018 | + $fillPattern = self::getUInt2d($options, 0); |
| 8019 | + // bit: 10-15; mask: 0xFC00; type |
| 8020 | + $fillPattern = (0xFC00 & $fillPattern) >> 10; |
| 8021 | + $fillPattern = FillPattern::lookup($fillPattern); |
| 8022 | + $fillPattern = $fillPattern === Fill::FILL_NONE ? Fill::FILL_SOLID : $fillPattern; |
| 8023 | + |
| 8024 | + if ($fillPattern !== Fill::FILL_NONE) { |
| 8025 | + $style->getFill()->setFillType($fillPattern); |
| 8026 | + |
| 8027 | + $fillColors = self::getUInt2d($options, 2); |
| 8028 | + |
| 8029 | + // bit: 0-6; mask: 0x007F; type |
| 8030 | + $color1 = (0x007F & $fillColors) >> 0; |
| 8031 | + $style->getFill()->getStartColor()->setRGB(Xls\Color::map($color1, $this->palette, $this->version)['rgb']); |
| 8032 | + |
| 8033 | + // bit: 7-13; mask: 0x3F80; type |
| 8034 | + $color2 = (0x3F80 & $fillColors) >> 7; |
| 8035 | + $style->getFill()->getEndColor()->setRGB(Xls\Color::map($color2, $this->palette, $this->version)['rgb']); |
| 8036 | + } |
8016 | 8037 | }
|
8017 | 8038 |
|
8018 | 8039 | private function getCFProtectionStyle(string $options, Style $style): void
|
|
0 commit comments