@@ -7937,7 +7937,6 @@ public function getMapCellStyleXfIndex(): array
7937
7937
7938
7938
private function readCFHeader (): array
7939
7939
{
7940
- // var_dump('FOUND CF HEADER');
7941
7940
$ length = self ::getUInt2d ($ this ->data , $ this ->pos + 2 );
7942
7941
$ recordData = $ this ->readRecordData ($ this ->data , $ this ->pos + 4 , $ length );
7943
7942
@@ -7949,22 +7948,19 @@ private function readCFHeader(): array
7949
7948
}
7950
7949
7951
7950
// offset: 0; size: 2; Rule Count
7952
- $ ruleCount = self ::getUInt2d ($ recordData , 0 );
7951
+ // $ruleCount = self::getUInt2d($recordData, 0);
7953
7952
7954
7953
// offset: var; size: var; cell range address list with
7955
7954
$ cellRangeAddressList = ($ this ->version == self ::XLS_BIFF8 )
7956
7955
? $ this ->readBIFF8CellRangeAddressList (substr ($ recordData , 12 ))
7957
7956
: $ this ->readBIFF5CellRangeAddressList (substr ($ recordData , 12 ));
7958
7957
$ cellRangeAddresses = $ cellRangeAddressList ['cellRangeAddresses ' ];
7959
7958
7960
- // var_dump($ruleCount, $cellRangeAddresses);
7961
- //
7962
7959
return $ cellRangeAddresses ;
7963
7960
}
7964
7961
7965
7962
private function readCFRule (array $ cellRangeAddresses ): void
7966
7963
{
7967
- // var_dump('FOUND CF RULE');
7968
7964
$ length = self ::getUInt2d ($ this ->data , $ this ->pos + 2 );
7969
7965
$ recordData = $ this ->readRecordData ($ this ->data , $ this ->pos + 4 , $ length );
7970
7966
@@ -8040,15 +8036,12 @@ private function readCFRule(array $cellRangeAddresses): void
8040
8036
$ offset += 2 ;
8041
8037
}
8042
8038
8043
- // var_dump($type, $operator);
8044
- //
8045
8039
$ formula1 = $ formula2 = null ;
8046
8040
if ($ size1 > 0 ) {
8047
8041
$ formula1 = $ this ->readCFFormula ($ recordData , $ offset , $ size1 );
8048
8042
if ($ formula1 === null ) {
8049
8043
return ;
8050
8044
}
8051
- // var_dump($formula1);
8052
8045
8053
8046
$ offset += $ size1 ;
8054
8047
}
@@ -8058,7 +8051,6 @@ private function readCFRule(array $cellRangeAddresses): void
8058
8051
if ($ formula2 === null ) {
8059
8052
return ;
8060
8053
}
8061
- // var_dump($formula2);
8062
8054
8063
8055
$ offset += $ size2 ;
8064
8056
}
@@ -8073,20 +8065,19 @@ private function getCFStyleOptions(int $options, Style $style): void
8073
8065
private function getCFFontStyle (string $ options , Style $ style ): void
8074
8066
{
8075
8067
$ fontSize = self ::getInt4d ($ options , 64 );
8076
- $ fontSize = ($ fontSize !== -1 ) ? $ fontSize / 20 : -1 ;
8068
+ if ($ fontSize !== -1 ) {
8069
+ $ style ->getFont ()->setSize ($ fontSize / 20 ); // Convert twips to points
8070
+ }
8071
+
8072
+
8077
8073
$ bold = self ::getUInt2d ($ options , 72 ) === 700 ; // 400 = normal, 700 = bold
8074
+ $ style ->getFont ()->setBold ($ bold );
8075
+
8078
8076
$ color = self ::getInt4d ($ options , 80 );
8079
8077
8080
- if ($ fontSize !== -1 ) {
8081
- $ style ->getFont ()->setSize ($ fontSize );
8082
- }
8083
8078
if ($ color !== -1 ) {
8084
- $ style ->getFont ()->setColor (
8085
- new \PhpOffice \PhpSpreadsheet \Style \Color (Color::map ($ color , $ this ->palette , $ this ->version )['rgb ' ])
8086
- );
8079
+ $ style ->getFont ()->getColor ()->setRGB (Color::map ($ color , $ this ->palette , $ this ->version )['rgb ' ]);
8087
8080
}
8088
- $ style ->getFont ()
8089
- ->setBold ($ bold );
8090
8081
}
8091
8082
8092
8083
private function getCFAlignmentStyle (string $ options , Style $ style ): void
0 commit comments