@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @var Excel2007\WriterPart[] |
42 | 42 | */ |
43 | - private $writerParts = array(); |
|
43 | + private $writerParts = array(); |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Private Spreadsheet |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @var string[] |
56 | 56 | */ |
57 | - private $stringTable = array(); |
|
57 | + private $stringTable = array(); |
|
58 | 58 | |
59 | 59 | /** |
60 | 60 | * Private unique \PhpSpreadsheet\Style\Conditional HashTable |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @var \PhpSpreadsheet\HashTable |
91 | 91 | */ |
92 | - private $bordersHashTable ; |
|
92 | + private $bordersHashTable; |
|
93 | 93 | |
94 | 94 | /** |
95 | 95 | * Private unique \PhpSpreadsheet\Style\NumberFormat HashTable |
@@ -137,14 +137,14 @@ discard block |
||
137 | 137 | $this->writerParts[$writer] = new $class($this); |
138 | 138 | } |
139 | 139 | |
140 | - $hashTablesArray = array( 'stylesConditionalHashTable', 'fillHashTable', 'fontHashTable', |
|
141 | - 'bordersHashTable', 'numFmtHashTable', 'drawingHashTable', |
|
140 | + $hashTablesArray = array('stylesConditionalHashTable', 'fillHashTable', 'fontHashTable', |
|
141 | + 'bordersHashTable', 'numFmtHashTable', 'drawingHashTable', |
|
142 | 142 | 'styleHashTable' |
143 | 143 | ); |
144 | 144 | |
145 | 145 | // Set HashTable variables |
146 | 146 | foreach ($hashTablesArray as $tableName) { |
147 | - $this->$tableName = new \PhpSpreadsheet\HashTable(); |
|
147 | + $this->$tableName = new \PhpSpreadsheet\HashTable(); |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
@@ -232,9 +232,9 @@ discard block |
||
232 | 232 | |
233 | 233 | //if hasMacros, add the vbaProject.bin file, Certificate file(if exists) |
234 | 234 | if ($this->spreadSheet->hasMacros()) { |
235 | - $macrosCode=$this->spreadSheet->getMacrosCode(); |
|
235 | + $macrosCode = $this->spreadSheet->getMacrosCode(); |
|
236 | 236 | if (!is_null($macrosCode)) {// we have the code ? |
237 | - $objZip->addFromString('xl/vbaProject.bin', $macrosCode);//allways in 'xl', allways named vbaProject.bin |
|
237 | + $objZip->addFromString('xl/vbaProject.bin', $macrosCode); //allways in 'xl', allways named vbaProject.bin |
|
238 | 238 | if ($this->spreadSheet->hasMacrosCertificate()) {//signed macros ? |
239 | 239 | // Yes : add the certificate file and the related rels file |
240 | 240 | $objZip->addFromString('xl/vbaProjectSignature.bin', $this->spreadSheet->getMacrosCertificate()); |
@@ -244,16 +244,16 @@ discard block |
||
244 | 244 | } |
245 | 245 | //a custom UI in this workbook ? add it ("base" xml and additional objects (pictures) and rels) |
246 | 246 | if ($this->spreadSheet->hasRibbon()) { |
247 | - $tmpRibbonTarget=$this->spreadSheet->getRibbonXMLData('target'); |
|
247 | + $tmpRibbonTarget = $this->spreadSheet->getRibbonXMLData('target'); |
|
248 | 248 | $objZip->addFromString($tmpRibbonTarget, $this->spreadSheet->getRibbonXMLData('data')); |
249 | 249 | if ($this->spreadSheet->hasRibbonBinObjects()) { |
250 | - $tmpRootPath=dirname($tmpRibbonTarget).'/'; |
|
251 | - $ribbonBinObjects=$this->spreadSheet->getRibbonBinObjects('data');//the files to write |
|
250 | + $tmpRootPath = dirname($tmpRibbonTarget) . '/'; |
|
251 | + $ribbonBinObjects = $this->spreadSheet->getRibbonBinObjects('data'); //the files to write |
|
252 | 252 | foreach ($ribbonBinObjects as $aPath => $aContent) { |
253 | - $objZip->addFromString($tmpRootPath.$aPath, $aContent); |
|
253 | + $objZip->addFromString($tmpRootPath . $aPath, $aContent); |
|
254 | 254 | } |
255 | 255 | //the rels for files |
256 | - $objZip->addFromString($tmpRootPath.'_rels/'.basename($tmpRibbonTarget).'.rels', $this->getWriterPart('RelsRibbonObjects')->writeRibbonRelationships($this->spreadSheet)); |
|
256 | + $objZip->addFromString($tmpRootPath . '_rels/' . basename($tmpRibbonTarget) . '.rels', $this->getWriterPart('RelsRibbonObjects')->writeRibbonRelationships($this->spreadSheet)); |
|
257 | 257 | } |
258 | 258 | } |
259 | 259 |
@@ -132,23 +132,23 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function __construct(\PhpSpreadsheet\Style $style = null) |
134 | 134 | { |
135 | - $this->isStyleXf = false; |
|
135 | + $this->isStyleXf = false; |
|
136 | 136 | $this->fontIndex = 0; |
137 | 137 | |
138 | - $this->numberFormatIndex = 0; |
|
138 | + $this->numberFormatIndex = 0; |
|
139 | 139 | |
140 | - $this->textJustLast = 0; |
|
140 | + $this->textJustLast = 0; |
|
141 | 141 | |
142 | 142 | $this->foregroundColor = 0x40; |
143 | 143 | $this->backgroundColor = 0x41; |
144 | 144 | |
145 | - $this->_diag = 0; |
|
145 | + $this->_diag = 0; |
|
146 | 146 | |
147 | 147 | $this->bottomBorderColor = 0x40; |
148 | 148 | $this->topBorderColor = 0x40; |
149 | 149 | $this->leftBorderColor = 0x40; |
150 | 150 | $this->rightBorderColor = 0x40; |
151 | - $this->_diag_color = 0x40; |
|
151 | + $this->_diag_color = 0x40; |
|
152 | 152 | $this->_style = $style; |
153 | 153 | } |
154 | 154 | |
@@ -169,16 +169,16 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | // Flags to indicate if attributes have been set. |
172 | - $atr_num = ($this->numberFormatIndex != 0)?1:0; |
|
173 | - $atr_fnt = ($this->fontIndex != 0)?1:0; |
|
172 | + $atr_num = ($this->numberFormatIndex != 0) ? 1 : 0; |
|
173 | + $atr_fnt = ($this->fontIndex != 0) ? 1 : 0; |
|
174 | 174 | $atr_alc = ((int) $this->_style->getAlignment()->getWrapText()) ? 1 : 0; |
175 | - $atr_bdr = (self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) || |
|
176 | - self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) || |
|
177 | - self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) || |
|
178 | - self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()))?1:0; |
|
175 | + $atr_bdr = (self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) || |
|
176 | + self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) || |
|
177 | + self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) || |
|
178 | + self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle())) ? 1 : 0; |
|
179 | 179 | $atr_pat = (($this->foregroundColor != 0x40) || |
180 | 180 | ($this->backgroundColor != 0x41) || |
181 | - self::mapFillType($this->_style->getFill()->getFillType()))?1:0; |
|
181 | + self::mapFillType($this->_style->getFill()->getFillType())) ? 1 : 0; |
|
182 | 182 | $atr_prot = self::mapLocked($this->_style->getProtection()->getLocked()) |
183 | 183 | | self::mapHidden($this->_style->getProtection()->getHidden()); |
184 | 184 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | if (self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) == 0) { |
187 | 187 | $this->bottomBorderColor = 0; |
188 | 188 | } |
189 | - if (self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) == 0) { |
|
189 | + if (self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) == 0) { |
|
190 | 190 | $this->topBorderColor = 0; |
191 | 191 | } |
192 | 192 | if (self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) == 0) { |
@@ -199,47 +199,47 @@ discard block |
||
199 | 199 | $this->_diag_color = 0; |
200 | 200 | } |
201 | 201 | |
202 | - $record = 0x00E0; // Record identifier |
|
203 | - $length = 0x0014; // Number of bytes to follow |
|
202 | + $record = 0x00E0; // Record identifier |
|
203 | + $length = 0x0014; // Number of bytes to follow |
|
204 | 204 | |
205 | - $ifnt = $this->fontIndex; // Index to FONT record |
|
206 | - $ifmt = $this->numberFormatIndex; // Index to FORMAT record |
|
205 | + $ifnt = $this->fontIndex; // Index to FONT record |
|
206 | + $ifmt = $this->numberFormatIndex; // Index to FORMAT record |
|
207 | 207 | |
208 | - $align = $this->mapHAlign($this->_style->getAlignment()->getHorizontal()); // Alignment |
|
209 | - $align |= (int) $this->_style->getAlignment()->getWrapText() << 3; |
|
210 | - $align |= self::mapVAlign($this->_style->getAlignment()->getVertical()) << 4; |
|
208 | + $align = $this->mapHAlign($this->_style->getAlignment()->getHorizontal()); // Alignment |
|
209 | + $align |= (int) $this->_style->getAlignment()->getWrapText() << 3; |
|
210 | + $align |= self::mapVAlign($this->_style->getAlignment()->getVertical()) << 4; |
|
211 | 211 | $align |= $this->textJustLast << 7; |
212 | 212 | |
213 | - $used_attrib = $atr_num << 2; |
|
214 | - $used_attrib |= $atr_fnt << 3; |
|
215 | - $used_attrib |= $atr_alc << 4; |
|
216 | - $used_attrib |= $atr_bdr << 5; |
|
217 | - $used_attrib |= $atr_pat << 6; |
|
213 | + $used_attrib = $atr_num << 2; |
|
214 | + $used_attrib |= $atr_fnt << 3; |
|
215 | + $used_attrib |= $atr_alc << 4; |
|
216 | + $used_attrib |= $atr_bdr << 5; |
|
217 | + $used_attrib |= $atr_pat << 6; |
|
218 | 218 | $used_attrib |= $atr_prot << 7; |
219 | 219 | |
220 | - $icv = $this->foregroundColor; // fg and bg pattern colors |
|
221 | - $icv |= $this->backgroundColor << 7; |
|
220 | + $icv = $this->foregroundColor; // fg and bg pattern colors |
|
221 | + $icv |= $this->backgroundColor << 7; |
|
222 | 222 | |
223 | - $border1 = self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()); // Border line style and color |
|
224 | - $border1 |= self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) << 4; |
|
225 | - $border1 |= self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) << 8; |
|
226 | - $border1 |= self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) << 12; |
|
227 | - $border1 |= $this->leftBorderColor << 16; |
|
228 | - $border1 |= $this->rightBorderColor << 23; |
|
223 | + $border1 = self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()); // Border line style and color |
|
224 | + $border1 |= self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) << 4; |
|
225 | + $border1 |= self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) << 8; |
|
226 | + $border1 |= self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) << 12; |
|
227 | + $border1 |= $this->leftBorderColor << 16; |
|
228 | + $border1 |= $this->rightBorderColor << 23; |
|
229 | 229 | |
230 | 230 | $diagonalDirection = $this->_style->getBorders()->getDiagonalDirection(); |
231 | 231 | $diag_tl_to_rb = $diagonalDirection == \PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH |
232 | 232 | || $diagonalDirection == \PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN; |
233 | 233 | $diag_tr_to_lb = $diagonalDirection == \PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH |
234 | 234 | || $diagonalDirection == \PhpSpreadsheet\Style\Borders::DIAGONAL_UP; |
235 | - $border1 |= $diag_tl_to_rb << 30; |
|
236 | - $border1 |= $diag_tr_to_lb << 31; |
|
235 | + $border1 |= $diag_tl_to_rb << 30; |
|
236 | + $border1 |= $diag_tr_to_lb << 31; |
|
237 | 237 | |
238 | - $border2 = $this->topBorderColor; // Border color |
|
239 | - $border2 |= $this->bottomBorderColor << 7; |
|
240 | - $border2 |= $this->_diag_color << 14; |
|
241 | - $border2 |= self::mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) << 21; |
|
242 | - $border2 |= self::mapFillType($this->_style->getFill()->getFillType()) << 26; |
|
238 | + $border2 = $this->topBorderColor; // Border color |
|
239 | + $border2 |= $this->bottomBorderColor << 7; |
|
240 | + $border2 |= $this->_diag_color << 14; |
|
241 | + $border2 |= self::mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) << 21; |
|
242 | + $border2 |= self::mapFillType($this->_style->getFill()->getFillType()) << 26; |
|
243 | 243 | |
244 | 244 | $header = pack("vv", $record, $length); |
245 | 245 | |
@@ -425,8 +425,8 @@ discard block |
||
425 | 425 | \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTTRELLIS => 0x10, |
426 | 426 | \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125 => 0x11, |
427 | 427 | \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY0625 => 0x12, |
428 | - \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR => 0x00, // does not exist in BIFF8 |
|
429 | - \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH => 0x00, // does not exist in BIFF8 |
|
428 | + \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR => 0x00, // does not exist in BIFF8 |
|
429 | + \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH => 0x00, // does not exist in BIFF8 |
|
430 | 430 | ); |
431 | 431 | |
432 | 432 | /** |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | |
216 | 216 | $this->_preCalculateFormulas = $preCalculateFormulas; |
217 | 217 | $this->stringTotal = &$str_total; |
218 | - $this->stringUnique = &$str_unique; |
|
218 | + $this->stringUnique = &$str_unique; |
|
219 | 219 | $this->stringTable = &$str_table; |
220 | 220 | $this->colors = &$colors; |
221 | 221 | $this->parser = $parser; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | //$this->offset = 0; |
227 | 227 | $this->xlsStringMaxLength = 255; |
228 | 228 | $this->columnInfo = array(); |
229 | - $this->selection = array(0,0,0,0); |
|
229 | + $this->selection = array(0, 0, 0, 0); |
|
230 | 230 | $this->activePane = 3; |
231 | 231 | |
232 | 232 | $this->_print_headers = 0; |
@@ -242,12 +242,12 @@ discard block |
||
242 | 242 | $minR = 1; |
243 | 243 | $minC = 'A'; |
244 | 244 | |
245 | - $maxR = $this->phpSheet->getHighestRow(); |
|
245 | + $maxR = $this->phpSheet->getHighestRow(); |
|
246 | 246 | $maxC = $this->phpSheet->getHighestColumn(); |
247 | 247 | |
248 | 248 | // Determine lowest and highest column and row |
249 | 249 | // $this->firstRowIndex = ($minR > 65535) ? 65535 : $minR; |
250 | - $this->lastRowIndex = ($maxR > 65535) ? 65535 : $maxR ; |
|
250 | + $this->lastRowIndex = ($maxR > 65535) ? 65535 : $maxR; |
|
251 | 251 | |
252 | 252 | $this->firstColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($minC); |
253 | 253 | $this->lastColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($maxC); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | } |
295 | 295 | |
296 | 296 | $columnDimensions = $phpSheet->getColumnDimensions(); |
297 | - $maxCol = $this->lastColumnIndex -1; |
|
297 | + $maxCol = $this->lastColumnIndex - 1; |
|
298 | 298 | for ($i = 0; $i <= $maxCol; ++$i) { |
299 | 299 | $hidden = 0; |
300 | 300 | $level = 0; |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | } |
545 | 545 | |
546 | 546 | $firstCellCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($firstCell); // e.g. array(0, 1) |
547 | - $lastCellCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($lastCell); // e.g. array(1, 6) |
|
547 | + $lastCellCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($lastCell); // e.g. array(1, 6) |
|
548 | 548 | |
549 | 549 | return pack('vvvv', $firstCellCoordinates[1] - 1, $lastCellCoordinates[1] - 1, \PhpSpreadsheet\Cell::columnIndexFromString($firstCellCoordinates[0]) - 1, \PhpSpreadsheet\Cell::columnIndexFromString($lastCellCoordinates[0]) - 1); |
550 | 550 | } |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | |
562 | 562 | // Return data stored in memory |
563 | 563 | if (isset($this->_data)) { |
564 | - $tmp = $this->_data; |
|
564 | + $tmp = $this->_data; |
|
565 | 565 | unset($this->_data); |
566 | 566 | return $tmp; |
567 | 567 | } |
@@ -618,17 +618,17 @@ discard block |
||
618 | 618 | */ |
619 | 619 | private function writeNumber($row, $col, $num, $xfIndex) |
620 | 620 | { |
621 | - $record = 0x0203; // Record identifier |
|
622 | - $length = 0x000E; // Number of bytes to follow |
|
621 | + $record = 0x0203; // Record identifier |
|
622 | + $length = 0x000E; // Number of bytes to follow |
|
623 | 623 | |
624 | - $header = pack("vv", $record, $length); |
|
625 | - $data = pack("vvv", $row, $col, $xfIndex); |
|
626 | - $xl_double = pack("d", $num); |
|
624 | + $header = pack("vv", $record, $length); |
|
625 | + $data = pack("vvv", $row, $col, $xfIndex); |
|
626 | + $xl_double = pack("d", $num); |
|
627 | 627 | if (self::getByteOrder()) { // if it's Big Endian |
628 | 628 | $xl_double = strrev($xl_double); |
629 | 629 | } |
630 | 630 | |
631 | - $this->append($header.$data.$xl_double); |
|
631 | + $this->append($header . $data . $xl_double); |
|
632 | 632 | return(0); |
633 | 633 | } |
634 | 634 | |
@@ -656,8 +656,8 @@ discard block |
||
656 | 656 | */ |
657 | 657 | private function writeRichTextString($row, $col, $str, $xfIndex, $arrcRun) |
658 | 658 | { |
659 | - $record = 0x00FD; // Record identifier |
|
660 | - $length = 0x000A; // Bytes to follow |
|
659 | + $record = 0x00FD; // Record identifier |
|
660 | + $length = 0x000A; // Bytes to follow |
|
661 | 661 | $str = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($str, $arrcRun); |
662 | 662 | |
663 | 663 | /* check if string is already present */ |
@@ -666,9 +666,9 @@ discard block |
||
666 | 666 | } |
667 | 667 | $this->stringTotal++; |
668 | 668 | |
669 | - $header = pack('vv', $record, $length); |
|
670 | - $data = pack('vvvV', $row, $col, $xfIndex, $this->stringTable[$str]); |
|
671 | - $this->append($header.$data); |
|
669 | + $header = pack('vv', $record, $length); |
|
670 | + $data = pack('vvvV', $row, $col, $xfIndex, $this->stringTable[$str]); |
|
671 | + $this->append($header . $data); |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | /** |
@@ -689,20 +689,20 @@ discard block |
||
689 | 689 | private function writeLabel($row, $col, $str, $xfIndex) |
690 | 690 | { |
691 | 691 | $strlen = strlen($str); |
692 | - $record = 0x0204; // Record identifier |
|
693 | - $length = 0x0008 + $strlen; // Bytes to follow |
|
692 | + $record = 0x0204; // Record identifier |
|
693 | + $length = 0x0008 + $strlen; // Bytes to follow |
|
694 | 694 | |
695 | 695 | $str_error = 0; |
696 | 696 | |
697 | 697 | if ($strlen > $this->xlsStringMaxLength) { // LABEL must be < 255 chars |
698 | - $str = substr($str, 0, $this->xlsStringMaxLength); |
|
698 | + $str = substr($str, 0, $this->xlsStringMaxLength); |
|
699 | 699 | $length = 0x0008 + $this->xlsStringMaxLength; |
700 | 700 | $strlen = $this->xlsStringMaxLength; |
701 | 701 | $str_error = -3; |
702 | 702 | } |
703 | 703 | |
704 | - $header = pack("vv", $record, $length); |
|
705 | - $data = pack("vvvv", $row, $col, $xfIndex, $strlen); |
|
704 | + $header = pack("vv", $record, $length); |
|
705 | + $data = pack("vvvv", $row, $col, $xfIndex, $strlen); |
|
706 | 706 | $this->append($header . $data . $str); |
707 | 707 | return($str_error); |
708 | 708 | } |
@@ -724,8 +724,8 @@ discard block |
||
724 | 724 | */ |
725 | 725 | private function writeLabelSst($row, $col, $str, $xfIndex) |
726 | 726 | { |
727 | - $record = 0x00FD; // Record identifier |
|
728 | - $length = 0x000A; // Bytes to follow |
|
727 | + $record = 0x00FD; // Record identifier |
|
728 | + $length = 0x000A; // Bytes to follow |
|
729 | 729 | |
730 | 730 | $str = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($str); |
731 | 731 | |
@@ -735,9 +735,9 @@ discard block |
||
735 | 735 | } |
736 | 736 | $this->stringTotal++; |
737 | 737 | |
738 | - $header = pack('vv', $record, $length); |
|
739 | - $data = pack('vvvV', $row, $col, $xfIndex, $this->stringTable[$str]); |
|
740 | - $this->append($header.$data); |
|
738 | + $header = pack('vv', $record, $length); |
|
739 | + $data = pack('vvvV', $row, $col, $xfIndex, $this->stringTable[$str]); |
|
740 | + $this->append($header . $data); |
|
741 | 741 | } |
742 | 742 | |
743 | 743 | /** |
@@ -750,14 +750,14 @@ discard block |
||
750 | 750 | */ |
751 | 751 | private function writeNote($row, $col, $note) |
752 | 752 | { |
753 | - $note_length = strlen($note); |
|
754 | - $record = 0x001C; // Record identifier |
|
755 | - $max_length = 2048; // Maximun length for a NOTE record |
|
753 | + $note_length = strlen($note); |
|
754 | + $record = 0x001C; // Record identifier |
|
755 | + $max_length = 2048; // Maximun length for a NOTE record |
|
756 | 756 | |
757 | 757 | // Length for this record is no more than 2048 + 6 |
758 | 758 | $length = 0x0006 + min($note_length, 2048); |
759 | 759 | $header = pack("vv", $record, $length); |
760 | - $data = pack("vvv", $row, $col, $note_length); |
|
760 | + $data = pack("vvv", $row, $col, $note_length); |
|
761 | 761 | $this->append($header . $data . substr($note, 0, 2048)); |
762 | 762 | |
763 | 763 | for ($i = $max_length; $i < $note_length; $i += $max_length) { |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | $length = 0x0006 + strlen($chunk); |
766 | 766 | $header = pack("vv", $record, $length); |
767 | 767 | $data = pack("vvv", -1, 0, strlen($chunk)); |
768 | - $this->append($header.$data.$chunk); |
|
768 | + $this->append($header . $data . $chunk); |
|
769 | 769 | } |
770 | 770 | return(0); |
771 | 771 | } |
@@ -788,8 +788,8 @@ discard block |
||
788 | 788 | */ |
789 | 789 | public function writeBlank($row, $col, $xfIndex) |
790 | 790 | { |
791 | - $record = 0x0201; // Record identifier |
|
792 | - $length = 0x0006; // Number of bytes to follow |
|
791 | + $record = 0x0201; // Record identifier |
|
792 | + $length = 0x0006; // Number of bytes to follow |
|
793 | 793 | |
794 | 794 | $header = pack("vv", $record, $length); |
795 | 795 | $data = pack("vvv", $row, $col, $xfIndex); |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | */ |
836 | 836 | private function writeFormula($row, $col, $formula, $xfIndex, $calculatedValue) |
837 | 837 | { |
838 | - $record = 0x0006; // Record identifier |
|
838 | + $record = 0x0006; // Record identifier |
|
839 | 839 | |
840 | 840 | // Initialize possible additional value for STRING record that should be written after the FORMULA record? |
841 | 841 | $stringValue = null; |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | // we use best effort to determine data type |
847 | 847 | if (is_bool($calculatedValue)) { |
848 | 848 | // Boolean value |
849 | - $num = pack('CCCvCv', 0x01, 0x00, (int)$calculatedValue, 0x00, 0x00, 0xFFFF); |
|
849 | + $num = pack('CCCvCv', 0x01, 0x00, (int) $calculatedValue, 0x00, 0x00, 0xFFFF); |
|
850 | 850 | } elseif (is_int($calculatedValue) || is_float($calculatedValue)) { |
851 | 851 | // Numeric value |
852 | 852 | $num = pack('d', $calculatedValue); |
@@ -870,8 +870,8 @@ discard block |
||
870 | 870 | $num = pack('d', 0x00); |
871 | 871 | } |
872 | 872 | |
873 | - $grbit = 0x03; // Option flags |
|
874 | - $unknown = 0x0000; // Must be zero |
|
873 | + $grbit = 0x03; // Option flags |
|
874 | + $unknown = 0x0000; // Must be zero |
|
875 | 875 | |
876 | 876 | // Strip the '=' or '@' sign at the beginning of the formula string |
877 | 877 | if ($formula{0} == '=') { |
@@ -887,8 +887,8 @@ discard block |
||
887 | 887 | $error = $this->parser->parse($formula); |
888 | 888 | $formula = $this->parser->toReversePolish(); |
889 | 889 | |
890 | - $formlen = strlen($formula); // Length of the binary string |
|
891 | - $length = 0x16 + $formlen; // Length of the record data |
|
890 | + $formlen = strlen($formula); // Length of the binary string |
|
891 | + $length = 0x16 + $formlen; // Length of the record data |
|
892 | 892 | |
893 | 893 | $header = pack("vv", $record, $length); |
894 | 894 | |
@@ -914,7 +914,7 @@ discard block |
||
914 | 914 | */ |
915 | 915 | private function writeStringRecord($stringValue) |
916 | 916 | { |
917 | - $record = 0x0207; // Record identifier |
|
917 | + $record = 0x0207; // Record identifier |
|
918 | 918 | $data = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($stringValue); |
919 | 919 | |
920 | 920 | $length = strlen($data); |
@@ -992,8 +992,8 @@ discard block |
||
992 | 992 | */ |
993 | 993 | public function writeUrlWeb($row1, $col1, $row2, $col2, $url) |
994 | 994 | { |
995 | - $record = 0x01B8; // Record identifier |
|
996 | - $length = 0x00000; // Bytes to follow |
|
995 | + $record = 0x01B8; // Record identifier |
|
996 | + $length = 0x00000; // Bytes to follow |
|
997 | 997 | |
998 | 998 | // Pack the undocumented parts of the hyperlink stream |
999 | 999 | $unknown1 = pack("H*", "D0C9EA79F9BACE118C8200AA004BA90B02000000"); |
@@ -1037,8 +1037,8 @@ discard block |
||
1037 | 1037 | */ |
1038 | 1038 | public function writeUrlInternal($row1, $col1, $row2, $col2, $url) |
1039 | 1039 | { |
1040 | - $record = 0x01B8; // Record identifier |
|
1041 | - $length = 0x00000; // Bytes to follow |
|
1040 | + $record = 0x01B8; // Record identifier |
|
1041 | + $length = 0x00000; // Bytes to follow |
|
1042 | 1042 | |
1043 | 1043 | // Strip URL type |
1044 | 1044 | $url = preg_replace('/^internal:/', '', $url); |
@@ -1096,8 +1096,8 @@ discard block |
||
1096 | 1096 | return; //($this->writeUrlExternal_net($row1, $col1, $row2, $col2, $url, $str, $format)); |
1097 | 1097 | } |
1098 | 1098 | |
1099 | - $record = 0x01B8; // Record identifier |
|
1100 | - $length = 0x00000; // Bytes to follow |
|
1099 | + $record = 0x01B8; // Record identifier |
|
1100 | + $length = 0x00000; // Bytes to follow |
|
1101 | 1101 | |
1102 | 1102 | // Strip URL type and change Unix dir separator to Dos style (if needed) |
1103 | 1103 | // |
@@ -1113,7 +1113,7 @@ discard block |
||
1113 | 1113 | if (preg_match('/^[A-Z]:/', $url)) { |
1114 | 1114 | $absolute = 0x02; // absolute path on Windows, e.g. C:\... |
1115 | 1115 | } |
1116 | - $link_type = 0x01 | $absolute; |
|
1116 | + $link_type = 0x01 | $absolute; |
|
1117 | 1117 | |
1118 | 1118 | // Determine if the link contains a sheet reference and change some of the |
1119 | 1119 | // parameters accordingly. |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | $dir_short = preg_replace("/\.\.\\\/", '', $dir_long) . "\0"; |
1136 | 1136 | |
1137 | 1137 | // Store the long dir name as a wchar string (non-null terminated) |
1138 | - $dir_long = $dir_long . "\0"; |
|
1138 | + $dir_long = $dir_long . "\0"; |
|
1139 | 1139 | |
1140 | 1140 | // Pack the lengths of the dir strings |
1141 | 1141 | $dir_short_len = pack("V", strlen($dir_short)); |
@@ -1149,15 +1149,15 @@ discard block |
||
1149 | 1149 | $unknown4 = pack("v", 0x03); |
1150 | 1150 | |
1151 | 1151 | // Pack the main data stream |
1152 | - $data = pack("vvvv", $row1, $row2, $col1, $col2) . |
|
1153 | - $unknown1 . |
|
1154 | - $link_type . |
|
1155 | - $unknown2 . |
|
1156 | - $up_count . |
|
1157 | - $dir_short_len. |
|
1158 | - $dir_short . |
|
1159 | - $unknown3 . |
|
1160 | - $stream_len ;/*. |
|
1152 | + $data = pack("vvvv", $row1, $row2, $col1, $col2) . |
|
1153 | + $unknown1 . |
|
1154 | + $link_type . |
|
1155 | + $unknown2 . |
|
1156 | + $up_count . |
|
1157 | + $dir_short_len . |
|
1158 | + $dir_short . |
|
1159 | + $unknown3 . |
|
1160 | + $stream_len; /*. |
|
1161 | 1161 | $dir_long_len . |
1162 | 1162 | $unknown4 . |
1163 | 1163 | $dir_long . |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | $header = pack("vv", $record, $length); |
1170 | 1170 | |
1171 | 1171 | // Write the packed data |
1172 | - $this->append($header. $data); |
|
1172 | + $this->append($header . $data); |
|
1173 | 1173 | return 0; |
1174 | 1174 | } |
1175 | 1175 | |
@@ -1185,14 +1185,14 @@ discard block |
||
1185 | 1185 | */ |
1186 | 1186 | private function writeRow($row, $height, $xfIndex, $hidden = false, $level = 0) |
1187 | 1187 | { |
1188 | - $record = 0x0208; // Record identifier |
|
1189 | - $length = 0x0010; // Number of bytes to follow |
|
1190 | - |
|
1191 | - $colMic = 0x0000; // First defined column |
|
1192 | - $colMac = 0x0000; // Last defined column |
|
1193 | - $irwMac = 0x0000; // Used by Excel to optimise loading |
|
1194 | - $reserved = 0x0000; // Reserved |
|
1195 | - $grbit = 0x0000; // Option flags |
|
1188 | + $record = 0x0208; // Record identifier |
|
1189 | + $length = 0x0010; // Number of bytes to follow |
|
1190 | + |
|
1191 | + $colMic = 0x0000; // First defined column |
|
1192 | + $colMac = 0x0000; // Last defined column |
|
1193 | + $irwMac = 0x0000; // Used by Excel to optimise loading |
|
1194 | + $reserved = 0x0000; // Reserved |
|
1195 | + $grbit = 0x0000; // Option flags |
|
1196 | 1196 | $ixfe = $xfIndex; |
1197 | 1197 | |
1198 | 1198 | if ($height < 0) { |
@@ -1201,9 +1201,9 @@ discard block |
||
1201 | 1201 | |
1202 | 1202 | // Use writeRow($row, null, $XF) to set XF format without setting height |
1203 | 1203 | if ($height != null) { |
1204 | - $miyRw = $height * 20; // row height |
|
1204 | + $miyRw = $height * 20; // row height |
|
1205 | 1205 | } else { |
1206 | - $miyRw = 0xff; // default row height is 256 |
|
1206 | + $miyRw = 0xff; // default row height is 256 |
|
1207 | 1207 | } |
1208 | 1208 | |
1209 | 1209 | // Set the options flags. fUnsynced is used to show that the font and row |
@@ -1226,7 +1226,7 @@ discard block |
||
1226 | 1226 | |
1227 | 1227 | $header = pack("vv", $record, $length); |
1228 | 1228 | $data = pack("vvvvvvvv", $row, $colMic, $colMac, $miyRw, $irwMac, $reserved, $grbit, $ixfe); |
1229 | - $this->append($header.$data); |
|
1229 | + $this->append($header . $data); |
|
1230 | 1230 | } |
1231 | 1231 | |
1232 | 1232 | /** |
@@ -1240,7 +1240,7 @@ discard block |
||
1240 | 1240 | $data = pack('VVvvv', $this->firstRowIndex, $this->lastRowIndex + 1, $this->firstColumnIndex, $this->lastColumnIndex + 1, 0x0000); // reserved |
1241 | 1241 | |
1242 | 1242 | $header = pack("vv", $record, $length); |
1243 | - $this->append($header.$data); |
|
1243 | + $this->append($header . $data); |
|
1244 | 1244 | } |
1245 | 1245 | |
1246 | 1246 | /** |
@@ -1248,53 +1248,53 @@ discard block |
||
1248 | 1248 | */ |
1249 | 1249 | private function writeWindow2() |
1250 | 1250 | { |
1251 | - $record = 0x023E; // Record identifier |
|
1251 | + $record = 0x023E; // Record identifier |
|
1252 | 1252 | $length = 0x0012; |
1253 | 1253 | |
1254 | - $grbit = 0x00B6; // Option flags |
|
1255 | - $rwTop = 0x0000; // Top row visible in window |
|
1256 | - $colLeft = 0x0000; // Leftmost column visible in window |
|
1254 | + $grbit = 0x00B6; // Option flags |
|
1255 | + $rwTop = 0x0000; // Top row visible in window |
|
1256 | + $colLeft = 0x0000; // Leftmost column visible in window |
|
1257 | 1257 | |
1258 | 1258 | |
1259 | 1259 | // The options flags that comprise $grbit |
1260 | - $fDspFmla = 0; // 0 - bit |
|
1260 | + $fDspFmla = 0; // 0 - bit |
|
1261 | 1261 | $fDspGrid = $this->phpSheet->getShowGridlines() ? 1 : 0; // 1 |
1262 | 1262 | $fDspRwCol = $this->phpSheet->getShowRowColHeaders() ? 1 : 0; // 2 |
1263 | - $fFrozen = $this->phpSheet->getFreezePane() ? 1 : 0; // 3 |
|
1264 | - $fDspZeros = 1; // 4 |
|
1265 | - $fDefaultHdr = 1; // 5 |
|
1263 | + $fFrozen = $this->phpSheet->getFreezePane() ? 1 : 0; // 3 |
|
1264 | + $fDspZeros = 1; // 4 |
|
1265 | + $fDefaultHdr = 1; // 5 |
|
1266 | 1266 | $fArabic = $this->phpSheet->getRightToLeft() ? 1 : 0; // 6 |
1267 | - $fDspGuts = $this->outlineOn; // 7 |
|
1268 | - $fFrozenNoSplit = 0; // 0 - bit |
|
1267 | + $fDspGuts = $this->outlineOn; // 7 |
|
1268 | + $fFrozenNoSplit = 0; // 0 - bit |
|
1269 | 1269 | // no support in PhpSpreadsheet for selected sheet, therefore sheet is only selected if it is the active sheet |
1270 | 1270 | $fSelected = ($this->phpSheet === $this->phpSheet->getParent()->getActiveSheet()) ? 1 : 0; |
1271 | - $fPaged = 1; // 2 |
|
1271 | + $fPaged = 1; // 2 |
|
1272 | 1272 | $fPageBreakPreview = $this->phpSheet->getSheetView()->getView() === \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW; |
1273 | 1273 | |
1274 | 1274 | $grbit = $fDspFmla; |
1275 | - $grbit |= $fDspGrid << 1; |
|
1276 | - $grbit |= $fDspRwCol << 2; |
|
1277 | - $grbit |= $fFrozen << 3; |
|
1278 | - $grbit |= $fDspZeros << 4; |
|
1279 | - $grbit |= $fDefaultHdr << 5; |
|
1280 | - $grbit |= $fArabic << 6; |
|
1281 | - $grbit |= $fDspGuts << 7; |
|
1275 | + $grbit |= $fDspGrid << 1; |
|
1276 | + $grbit |= $fDspRwCol << 2; |
|
1277 | + $grbit |= $fFrozen << 3; |
|
1278 | + $grbit |= $fDspZeros << 4; |
|
1279 | + $grbit |= $fDefaultHdr << 5; |
|
1280 | + $grbit |= $fArabic << 6; |
|
1281 | + $grbit |= $fDspGuts << 7; |
|
1282 | 1282 | $grbit |= $fFrozenNoSplit << 8; |
1283 | - $grbit |= $fSelected << 9; |
|
1284 | - $grbit |= $fPaged << 10; |
|
1283 | + $grbit |= $fSelected << 9; |
|
1284 | + $grbit |= $fPaged << 10; |
|
1285 | 1285 | $grbit |= $fPageBreakPreview << 11; |
1286 | 1286 | |
1287 | 1287 | $header = pack("vv", $record, $length); |
1288 | 1288 | $data = pack("vvv", $grbit, $rwTop, $colLeft); |
1289 | 1289 | |
1290 | 1290 | // FIXME !!! |
1291 | - $rgbHdr = 0x0040; // Row/column heading and gridline color index |
|
1291 | + $rgbHdr = 0x0040; // Row/column heading and gridline color index |
|
1292 | 1292 | $zoom_factor_page_break = ($fPageBreakPreview ? $this->phpSheet->getSheetView()->getZoomScale() : 0x0000); |
1293 | - $zoom_factor_normal = $this->phpSheet->getSheetView()->getZoomScaleNormal(); |
|
1293 | + $zoom_factor_normal = $this->phpSheet->getSheetView()->getZoomScaleNormal(); |
|
1294 | 1294 | |
1295 | 1295 | $data .= pack("vvvvV", $rgbHdr, 0x0000, $zoom_factor_page_break, $zoom_factor_normal, 0x00000000); |
1296 | 1296 | |
1297 | - $this->append($header.$data); |
|
1297 | + $this->append($header . $data); |
|
1298 | 1298 | } |
1299 | 1299 | |
1300 | 1300 | /** |
@@ -1311,8 +1311,8 @@ discard block |
||
1311 | 1311 | // convert to twips |
1312 | 1312 | $defaultRowHeight = (int) 20 * $defaultRowHeight; |
1313 | 1313 | |
1314 | - $record = 0x0225; // Record identifier |
|
1315 | - $length = 0x0004; // Number of bytes to follow |
|
1314 | + $record = 0x0225; // Record identifier |
|
1315 | + $length = 0x0004; // Number of bytes to follow |
|
1316 | 1316 | |
1317 | 1317 | $header = pack("vv", $record, $length); |
1318 | 1318 | $data = pack("vv", 1, $defaultRowHeight); |
@@ -1326,8 +1326,8 @@ discard block |
||
1326 | 1326 | { |
1327 | 1327 | $defaultColWidth = 8; |
1328 | 1328 | |
1329 | - $record = 0x0055; // Record identifier |
|
1330 | - $length = 0x0002; // Number of bytes to follow |
|
1329 | + $record = 0x0055; // Record identifier |
|
1330 | + $length = 0x0002; // Number of bytes to follow |
|
1331 | 1331 | |
1332 | 1332 | $header = pack("vv", $record, $length); |
1333 | 1333 | $data = pack("v", $defaultColWidth); |
@@ -1376,20 +1376,20 @@ discard block |
||
1376 | 1376 | } else { |
1377 | 1377 | $level = 0; |
1378 | 1378 | } |
1379 | - $record = 0x007D; // Record identifier |
|
1380 | - $length = 0x000C; // Number of bytes to follow |
|
1379 | + $record = 0x007D; // Record identifier |
|
1380 | + $length = 0x000C; // Number of bytes to follow |
|
1381 | 1381 | |
1382 | - $coldx *= 256; // Convert to units of 1/256 of a char |
|
1382 | + $coldx *= 256; // Convert to units of 1/256 of a char |
|
1383 | 1383 | |
1384 | 1384 | $ixfe = $xfIndex; |
1385 | - $reserved = 0x0000; // Reserved |
|
1385 | + $reserved = 0x0000; // Reserved |
|
1386 | 1386 | |
1387 | 1387 | $level = max(0, min($level, 7)); |
1388 | 1388 | $grbit |= $level << 8; |
1389 | 1389 | |
1390 | 1390 | $header = pack("vv", $record, $length); |
1391 | 1391 | $data = pack("vvvvvv", $colFirst, $colLast, $coldx, $ixfe, $grbit, $reserved); |
1392 | - $this->append($header.$data); |
|
1392 | + $this->append($header . $data); |
|
1393 | 1393 | } |
1394 | 1394 | |
1395 | 1395 | /** |
@@ -1423,20 +1423,20 @@ discard block |
||
1423 | 1423 | $rwFirst = min($rwFirst, 65535); |
1424 | 1424 | $rwLast = min($rwLast, 65535); |
1425 | 1425 | |
1426 | - $record = 0x001D; // Record identifier |
|
1427 | - $length = 0x000F; // Number of bytes to follow |
|
1426 | + $record = 0x001D; // Record identifier |
|
1427 | + $length = 0x000F; // Number of bytes to follow |
|
1428 | 1428 | |
1429 | - $pnn = $this->activePane; // Pane position |
|
1430 | - $rwAct = $rwFirst; // Active row |
|
1431 | - $colAct = $colFirst; // Active column |
|
1432 | - $irefAct = 0; // Active cell ref |
|
1433 | - $cref = 1; // Number of refs |
|
1429 | + $pnn = $this->activePane; // Pane position |
|
1430 | + $rwAct = $rwFirst; // Active row |
|
1431 | + $colAct = $colFirst; // Active column |
|
1432 | + $irefAct = 0; // Active cell ref |
|
1433 | + $cref = 1; // Number of refs |
|
1434 | 1434 | |
1435 | 1435 | if (!isset($rwLast)) { |
1436 | - $rwLast = $rwFirst; // Last row in reference |
|
1436 | + $rwLast = $rwFirst; // Last row in reference |
|
1437 | 1437 | } |
1438 | 1438 | if (!isset($colLast)) { |
1439 | - $colLast = $colFirst; // Last col in reference |
|
1439 | + $colLast = $colFirst; // Last col in reference |
|
1440 | 1440 | } |
1441 | 1441 | |
1442 | 1442 | // Swap last row/col for first row/col as necessary |
@@ -1543,21 +1543,21 @@ discard block |
||
1543 | 1543 | $record = 0x0867; |
1544 | 1544 | |
1545 | 1545 | // prepare options |
1546 | - $options = (int) !$this->phpSheet->getProtection()->getObjects() |
|
1547 | - | (int) !$this->phpSheet->getProtection()->getScenarios() << 1 |
|
1548 | - | (int) !$this->phpSheet->getProtection()->getFormatCells() << 2 |
|
1549 | - | (int) !$this->phpSheet->getProtection()->getFormatColumns() << 3 |
|
1550 | - | (int) !$this->phpSheet->getProtection()->getFormatRows() << 4 |
|
1551 | - | (int) !$this->phpSheet->getProtection()->getInsertColumns() << 5 |
|
1552 | - | (int) !$this->phpSheet->getProtection()->getInsertRows() << 6 |
|
1553 | - | (int) !$this->phpSheet->getProtection()->getInsertHyperlinks() << 7 |
|
1554 | - | (int) !$this->phpSheet->getProtection()->getDeleteColumns() << 8 |
|
1555 | - | (int) !$this->phpSheet->getProtection()->getDeleteRows() << 9 |
|
1556 | - | (int) !$this->phpSheet->getProtection()->getSelectLockedCells() << 10 |
|
1557 | - | (int) !$this->phpSheet->getProtection()->getSort() << 11 |
|
1558 | - | (int) !$this->phpSheet->getProtection()->getAutoFilter() << 12 |
|
1559 | - | (int) !$this->phpSheet->getProtection()->getPivotTables() << 13 |
|
1560 | - | (int) !$this->phpSheet->getProtection()->getSelectUnlockedCells() << 14 ; |
|
1546 | + $options = (int) !$this->phpSheet->getProtection()->getObjects() |
|
1547 | + | (int) !$this->phpSheet->getProtection()->getScenarios() << 1 |
|
1548 | + | (int) !$this->phpSheet->getProtection()->getFormatCells() << 2 |
|
1549 | + | (int) !$this->phpSheet->getProtection()->getFormatColumns() << 3 |
|
1550 | + | (int) !$this->phpSheet->getProtection()->getFormatRows() << 4 |
|
1551 | + | (int) !$this->phpSheet->getProtection()->getInsertColumns() << 5 |
|
1552 | + | (int) !$this->phpSheet->getProtection()->getInsertRows() << 6 |
|
1553 | + | (int) !$this->phpSheet->getProtection()->getInsertHyperlinks() << 7 |
|
1554 | + | (int) !$this->phpSheet->getProtection()->getDeleteColumns() << 8 |
|
1555 | + | (int) !$this->phpSheet->getProtection()->getDeleteRows() << 9 |
|
1556 | + | (int) !$this->phpSheet->getProtection()->getSelectLockedCells() << 10 |
|
1557 | + | (int) !$this->phpSheet->getProtection()->getSort() << 11 |
|
1558 | + | (int) !$this->phpSheet->getProtection()->getAutoFilter() << 12 |
|
1559 | + | (int) !$this->phpSheet->getProtection()->getPivotTables() << 13 |
|
1560 | + | (int) !$this->phpSheet->getProtection()->getSelectUnlockedCells() << 14; |
|
1561 | 1561 | |
1562 | 1562 | // record data |
1563 | 1563 | $recordData = pack( |
@@ -1620,7 +1620,7 @@ discard block |
||
1620 | 1620 | |
1621 | 1621 | $length = strlen($recordData); |
1622 | 1622 | |
1623 | - $record = 0x0868; // Record identifier |
|
1623 | + $record = 0x0868; // Record identifier |
|
1624 | 1624 | $header = pack("vv", $record, $length); |
1625 | 1625 | $this->append($header . $recordData); |
1626 | 1626 | } |
@@ -1640,8 +1640,8 @@ discard block |
||
1640 | 1640 | */ |
1641 | 1641 | private function writeExterncount($count) |
1642 | 1642 | { |
1643 | - $record = 0x0016; // Record identifier |
|
1644 | - $length = 0x0002; // Number of bytes to follow |
|
1643 | + $record = 0x0016; // Record identifier |
|
1644 | + $length = 0x0002; // Number of bytes to follow |
|
1645 | 1645 | |
1646 | 1646 | $header = pack("vv", $record, $length); |
1647 | 1647 | $data = pack("v", $count); |
@@ -1658,20 +1658,20 @@ discard block |
||
1658 | 1658 | */ |
1659 | 1659 | private function writeExternsheet($sheetname) |
1660 | 1660 | { |
1661 | - $record = 0x0017; // Record identifier |
|
1661 | + $record = 0x0017; // Record identifier |
|
1662 | 1662 | |
1663 | 1663 | // References to the current sheet are encoded differently to references to |
1664 | 1664 | // external sheets. |
1665 | 1665 | // |
1666 | 1666 | if ($this->phpSheet->getTitle() == $sheetname) { |
1667 | 1667 | $sheetname = ''; |
1668 | - $length = 0x02; // The following 2 bytes |
|
1669 | - $cch = 1; // The following byte |
|
1670 | - $rgch = 0x02; // Self reference |
|
1668 | + $length = 0x02; // The following 2 bytes |
|
1669 | + $cch = 1; // The following byte |
|
1670 | + $rgch = 0x02; // Self reference |
|
1671 | 1671 | } else { |
1672 | 1672 | $length = 0x02 + strlen($sheetname); |
1673 | 1673 | $cch = strlen($sheetname); |
1674 | - $rgch = 0x03; // Reference to a sheet in the current workbook |
|
1674 | + $rgch = 0x03; // Reference to a sheet in the current workbook |
|
1675 | 1675 | } |
1676 | 1676 | |
1677 | 1677 | $header = pack("vv", $record, $length); |
@@ -1706,8 +1706,8 @@ discard block |
||
1706 | 1706 | } else { |
1707 | 1707 | $pnnAct = null; |
1708 | 1708 | } |
1709 | - $record = 0x0041; // Record identifier |
|
1710 | - $length = 0x000A; // Number of bytes to follow |
|
1709 | + $record = 0x0041; // Record identifier |
|
1710 | + $length = 0x000A; // Number of bytes to follow |
|
1711 | 1711 | |
1712 | 1712 | // Code specific to frozen or thawed panes. |
1713 | 1713 | if ($this->phpSheet->getFreezePane()) { |
@@ -1732,8 +1732,8 @@ discard block |
||
1732 | 1732 | // The default column width is 8.43 |
1733 | 1733 | // The following slope and intersection values were interpolated. |
1734 | 1734 | // |
1735 | - $y = 20*$y + 255; |
|
1736 | - $x = 113.879*$x + 390; |
|
1735 | + $y = 20 * $y + 255; |
|
1736 | + $x = 113.879 * $x + 390; |
|
1737 | 1737 | } |
1738 | 1738 | |
1739 | 1739 | |
@@ -1767,47 +1767,47 @@ discard block |
||
1767 | 1767 | */ |
1768 | 1768 | private function writeSetup() |
1769 | 1769 | { |
1770 | - $record = 0x00A1; // Record identifier |
|
1771 | - $length = 0x0022; // Number of bytes to follow |
|
1770 | + $record = 0x00A1; // Record identifier |
|
1771 | + $length = 0x0022; // Number of bytes to follow |
|
1772 | 1772 | |
1773 | - $iPaperSize = $this->phpSheet->getPageSetup()->getPaperSize(); // Paper size |
|
1773 | + $iPaperSize = $this->phpSheet->getPageSetup()->getPaperSize(); // Paper size |
|
1774 | 1774 | |
1775 | 1775 | $iScale = $this->phpSheet->getPageSetup()->getScale() ? |
1776 | - $this->phpSheet->getPageSetup()->getScale() : 100; // Print scaling factor |
|
1776 | + $this->phpSheet->getPageSetup()->getScale() : 100; // Print scaling factor |
|
1777 | 1777 | |
1778 | - $iPageStart = 0x01; // Starting page number |
|
1779 | - $iFitWidth = (int) $this->phpSheet->getPageSetup()->getFitToWidth(); // Fit to number of pages wide |
|
1780 | - $iFitHeight = (int) $this->phpSheet->getPageSetup()->getFitToHeight(); // Fit to number of pages high |
|
1781 | - $grbit = 0x00; // Option flags |
|
1782 | - $iRes = 0x0258; // Print resolution |
|
1783 | - $iVRes = 0x0258; // Vertical print resolution |
|
1778 | + $iPageStart = 0x01; // Starting page number |
|
1779 | + $iFitWidth = (int) $this->phpSheet->getPageSetup()->getFitToWidth(); // Fit to number of pages wide |
|
1780 | + $iFitHeight = (int) $this->phpSheet->getPageSetup()->getFitToHeight(); // Fit to number of pages high |
|
1781 | + $grbit = 0x00; // Option flags |
|
1782 | + $iRes = 0x0258; // Print resolution |
|
1783 | + $iVRes = 0x0258; // Vertical print resolution |
|
1784 | 1784 | |
1785 | - $numHdr = $this->phpSheet->getPageMargins()->getHeader(); // Header Margin |
|
1785 | + $numHdr = $this->phpSheet->getPageMargins()->getHeader(); // Header Margin |
|
1786 | 1786 | |
1787 | - $numFtr = $this->phpSheet->getPageMargins()->getFooter(); // Footer Margin |
|
1788 | - $iCopies = 0x01; // Number of copies |
|
1787 | + $numFtr = $this->phpSheet->getPageMargins()->getFooter(); // Footer Margin |
|
1788 | + $iCopies = 0x01; // Number of copies |
|
1789 | 1789 | |
1790 | - $fLeftToRight = 0x0; // Print over then down |
|
1790 | + $fLeftToRight = 0x0; // Print over then down |
|
1791 | 1791 | |
1792 | 1792 | // Page orientation |
1793 | 1793 | $fLandscape = ($this->phpSheet->getPageSetup()->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? |
1794 | 1794 | 0x0 : 0x1; |
1795 | 1795 | |
1796 | - $fNoPls = 0x0; // Setup not read from printer |
|
1797 | - $fNoColor = 0x0; // Print black and white |
|
1798 | - $fDraft = 0x0; // Print draft quality |
|
1799 | - $fNotes = 0x0; // Print notes |
|
1800 | - $fNoOrient = 0x0; // Orientation not set |
|
1801 | - $fUsePage = 0x0; // Use custom starting page |
|
1796 | + $fNoPls = 0x0; // Setup not read from printer |
|
1797 | + $fNoColor = 0x0; // Print black and white |
|
1798 | + $fDraft = 0x0; // Print draft quality |
|
1799 | + $fNotes = 0x0; // Print notes |
|
1800 | + $fNoOrient = 0x0; // Orientation not set |
|
1801 | + $fUsePage = 0x0; // Use custom starting page |
|
1802 | 1802 | |
1803 | 1803 | $grbit = $fLeftToRight; |
1804 | - $grbit |= $fLandscape << 1; |
|
1805 | - $grbit |= $fNoPls << 2; |
|
1806 | - $grbit |= $fNoColor << 3; |
|
1807 | - $grbit |= $fDraft << 4; |
|
1808 | - $grbit |= $fNotes << 5; |
|
1809 | - $grbit |= $fNoOrient << 6; |
|
1810 | - $grbit |= $fUsePage << 7; |
|
1804 | + $grbit |= $fLandscape << 1; |
|
1805 | + $grbit |= $fNoPls << 2; |
|
1806 | + $grbit |= $fNoColor << 3; |
|
1807 | + $grbit |= $fDraft << 4; |
|
1808 | + $grbit |= $fNotes << 5; |
|
1809 | + $grbit |= $fNoOrient << 6; |
|
1810 | + $grbit |= $fUsePage << 7; |
|
1811 | 1811 | |
1812 | 1812 | $numHdr = pack("d", $numHdr); |
1813 | 1813 | $numFtr = pack("d", $numFtr); |
@@ -1818,7 +1818,7 @@ discard block |
||
1818 | 1818 | |
1819 | 1819 | $header = pack("vv", $record, $length); |
1820 | 1820 | $data1 = pack("vvvvvvvv", $iPaperSize, $iScale, $iPageStart, $iFitWidth, $iFitHeight, $grbit, $iRes, $iVRes); |
1821 | - $data2 = $numHdr.$numFtr; |
|
1821 | + $data2 = $numHdr . $numFtr; |
|
1822 | 1822 | $data3 = pack("v", $iCopies); |
1823 | 1823 | $this->append($header . $data1 . $data2 . $data3); |
1824 | 1824 | } |
@@ -1828,7 +1828,7 @@ discard block |
||
1828 | 1828 | */ |
1829 | 1829 | private function writeHeader() |
1830 | 1830 | { |
1831 | - $record = 0x0014; // Record identifier |
|
1831 | + $record = 0x0014; // Record identifier |
|
1832 | 1832 | |
1833 | 1833 | /* removing for now |
1834 | 1834 | // need to fix character count (multibyte!) |
@@ -1842,7 +1842,7 @@ discard block |
||
1842 | 1842 | $recordData = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader()); |
1843 | 1843 | $length = strlen($recordData); |
1844 | 1844 | |
1845 | - $header = pack("vv", $record, $length); |
|
1845 | + $header = pack("vv", $record, $length); |
|
1846 | 1846 | |
1847 | 1847 | $this->append($header . $recordData); |
1848 | 1848 | } |
@@ -1852,7 +1852,7 @@ discard block |
||
1852 | 1852 | */ |
1853 | 1853 | private function writeFooter() |
1854 | 1854 | { |
1855 | - $record = 0x0015; // Record identifier |
|
1855 | + $record = 0x0015; // Record identifier |
|
1856 | 1856 | |
1857 | 1857 | /* removing for now |
1858 | 1858 | // need to fix character count (multibyte!) |
@@ -1866,7 +1866,7 @@ discard block |
||
1866 | 1866 | $recordData = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddFooter()); |
1867 | 1867 | $length = strlen($recordData); |
1868 | 1868 | |
1869 | - $header = pack("vv", $record, $length); |
|
1869 | + $header = pack("vv", $record, $length); |
|
1870 | 1870 | |
1871 | 1871 | $this->append($header . $recordData); |
1872 | 1872 | } |
@@ -1878,15 +1878,15 @@ discard block |
||
1878 | 1878 | */ |
1879 | 1879 | private function writeHcenter() |
1880 | 1880 | { |
1881 | - $record = 0x0083; // Record identifier |
|
1882 | - $length = 0x0002; // Bytes to follow |
|
1881 | + $record = 0x0083; // Record identifier |
|
1882 | + $length = 0x0002; // Bytes to follow |
|
1883 | 1883 | |
1884 | - $fHCenter = $this->phpSheet->getPageSetup()->getHorizontalCentered() ? 1 : 0; // Horizontal centering |
|
1884 | + $fHCenter = $this->phpSheet->getPageSetup()->getHorizontalCentered() ? 1 : 0; // Horizontal centering |
|
1885 | 1885 | |
1886 | 1886 | $header = pack("vv", $record, $length); |
1887 | 1887 | $data = pack("v", $fHCenter); |
1888 | 1888 | |
1889 | - $this->append($header.$data); |
|
1889 | + $this->append($header . $data); |
|
1890 | 1890 | } |
1891 | 1891 | |
1892 | 1892 | /** |
@@ -1894,10 +1894,10 @@ discard block |
||
1894 | 1894 | */ |
1895 | 1895 | private function writeVcenter() |
1896 | 1896 | { |
1897 | - $record = 0x0084; // Record identifier |
|
1898 | - $length = 0x0002; // Bytes to follow |
|
1897 | + $record = 0x0084; // Record identifier |
|
1898 | + $length = 0x0002; // Bytes to follow |
|
1899 | 1899 | |
1900 | - $fVCenter = $this->phpSheet->getPageSetup()->getVerticalCentered() ? 1 : 0; // Horizontal centering |
|
1900 | + $fVCenter = $this->phpSheet->getPageSetup()->getVerticalCentered() ? 1 : 0; // Horizontal centering |
|
1901 | 1901 | |
1902 | 1902 | $header = pack("vv", $record, $length); |
1903 | 1903 | $data = pack("v", $fVCenter); |
@@ -1909,10 +1909,10 @@ discard block |
||
1909 | 1909 | */ |
1910 | 1910 | private function writeMarginLeft() |
1911 | 1911 | { |
1912 | - $record = 0x0026; // Record identifier |
|
1913 | - $length = 0x0008; // Bytes to follow |
|
1912 | + $record = 0x0026; // Record identifier |
|
1913 | + $length = 0x0008; // Bytes to follow |
|
1914 | 1914 | |
1915 | - $margin = $this->phpSheet->getPageMargins()->getLeft(); // Margin in inches |
|
1915 | + $margin = $this->phpSheet->getPageMargins()->getLeft(); // Margin in inches |
|
1916 | 1916 | |
1917 | 1917 | $header = pack("vv", $record, $length); |
1918 | 1918 | $data = pack("d", $margin); |
@@ -1928,10 +1928,10 @@ discard block |
||
1928 | 1928 | */ |
1929 | 1929 | private function writeMarginRight() |
1930 | 1930 | { |
1931 | - $record = 0x0027; // Record identifier |
|
1932 | - $length = 0x0008; // Bytes to follow |
|
1931 | + $record = 0x0027; // Record identifier |
|
1932 | + $length = 0x0008; // Bytes to follow |
|
1933 | 1933 | |
1934 | - $margin = $this->phpSheet->getPageMargins()->getRight(); // Margin in inches |
|
1934 | + $margin = $this->phpSheet->getPageMargins()->getRight(); // Margin in inches |
|
1935 | 1935 | |
1936 | 1936 | $header = pack("vv", $record, $length); |
1937 | 1937 | $data = pack("d", $margin); |
@@ -1947,10 +1947,10 @@ discard block |
||
1947 | 1947 | */ |
1948 | 1948 | private function writeMarginTop() |
1949 | 1949 | { |
1950 | - $record = 0x0028; // Record identifier |
|
1951 | - $length = 0x0008; // Bytes to follow |
|
1950 | + $record = 0x0028; // Record identifier |
|
1951 | + $length = 0x0008; // Bytes to follow |
|
1952 | 1952 | |
1953 | - $margin = $this->phpSheet->getPageMargins()->getTop(); // Margin in inches |
|
1953 | + $margin = $this->phpSheet->getPageMargins()->getTop(); // Margin in inches |
|
1954 | 1954 | |
1955 | 1955 | $header = pack("vv", $record, $length); |
1956 | 1956 | $data = pack("d", $margin); |
@@ -1966,10 +1966,10 @@ discard block |
||
1966 | 1966 | */ |
1967 | 1967 | private function writeMarginBottom() |
1968 | 1968 | { |
1969 | - $record = 0x0029; // Record identifier |
|
1970 | - $length = 0x0008; // Bytes to follow |
|
1969 | + $record = 0x0029; // Record identifier |
|
1970 | + $length = 0x0008; // Bytes to follow |
|
1971 | 1971 | |
1972 | - $margin = $this->phpSheet->getPageMargins()->getBottom(); // Margin in inches |
|
1972 | + $margin = $this->phpSheet->getPageMargins()->getBottom(); // Margin in inches |
|
1973 | 1973 | |
1974 | 1974 | $header = pack("vv", $record, $length); |
1975 | 1975 | $data = pack("d", $margin); |
@@ -1985,10 +1985,10 @@ discard block |
||
1985 | 1985 | */ |
1986 | 1986 | private function writePrintHeaders() |
1987 | 1987 | { |
1988 | - $record = 0x002a; // Record identifier |
|
1989 | - $length = 0x0002; // Bytes to follow |
|
1988 | + $record = 0x002a; // Record identifier |
|
1989 | + $length = 0x0002; // Bytes to follow |
|
1990 | 1990 | |
1991 | - $fPrintRwCol = $this->_print_headers; // Boolean flag |
|
1991 | + $fPrintRwCol = $this->_print_headers; // Boolean flag |
|
1992 | 1992 | |
1993 | 1993 | $header = pack("vv", $record, $length); |
1994 | 1994 | $data = pack("v", $fPrintRwCol); |
@@ -2001,13 +2001,13 @@ discard block |
||
2001 | 2001 | */ |
2002 | 2002 | private function writePrintGridlines() |
2003 | 2003 | { |
2004 | - $record = 0x002b; // Record identifier |
|
2005 | - $length = 0x0002; // Bytes to follow |
|
2004 | + $record = 0x002b; // Record identifier |
|
2005 | + $length = 0x0002; // Bytes to follow |
|
2006 | 2006 | |
2007 | - $fPrintGrid = $this->phpSheet->getPrintGridlines() ? 1 : 0; // Boolean flag |
|
2007 | + $fPrintGrid = $this->phpSheet->getPrintGridlines() ? 1 : 0; // Boolean flag |
|
2008 | 2008 | |
2009 | 2009 | $header = pack("vv", $record, $length); |
2010 | - $data = pack("v", $fPrintGrid); |
|
2010 | + $data = pack("v", $fPrintGrid); |
|
2011 | 2011 | $this->append($header . $data); |
2012 | 2012 | } |
2013 | 2013 | |
@@ -2017,10 +2017,10 @@ discard block |
||
2017 | 2017 | */ |
2018 | 2018 | private function writeGridset() |
2019 | 2019 | { |
2020 | - $record = 0x0082; // Record identifier |
|
2021 | - $length = 0x0002; // Bytes to follow |
|
2020 | + $record = 0x0082; // Record identifier |
|
2021 | + $length = 0x0002; // Bytes to follow |
|
2022 | 2022 | |
2023 | - $fGridSet = !$this->phpSheet->getPrintGridlines(); // Boolean flag |
|
2023 | + $fGridSet = !$this->phpSheet->getPrintGridlines(); // Boolean flag |
|
2024 | 2024 | |
2025 | 2025 | $header = pack("vv", $record, $length); |
2026 | 2026 | $data = pack("v", $fGridSet); |
@@ -2032,8 +2032,8 @@ discard block |
||
2032 | 2032 | */ |
2033 | 2033 | private function writeAutoFilterInfo() |
2034 | 2034 | { |
2035 | - $record = 0x009D; // Record identifier |
|
2036 | - $length = 0x0002; // Bytes to follow |
|
2035 | + $record = 0x009D; // Record identifier |
|
2036 | + $length = 0x0002; // Bytes to follow |
|
2037 | 2037 | |
2038 | 2038 | $rangeBounds = \PhpSpreadsheet\Cell::rangeBoundaries($this->phpSheet->getAutoFilter()->getRange()); |
2039 | 2039 | $iNumFilters = 1 + $rangeBounds[1][0] - $rangeBounds[0][0]; |
@@ -2052,11 +2052,11 @@ discard block |
||
2052 | 2052 | */ |
2053 | 2053 | private function writeGuts() |
2054 | 2054 | { |
2055 | - $record = 0x0080; // Record identifier |
|
2056 | - $length = 0x0008; // Bytes to follow |
|
2055 | + $record = 0x0080; // Record identifier |
|
2056 | + $length = 0x0008; // Bytes to follow |
|
2057 | 2057 | |
2058 | - $dxRwGut = 0x0000; // Size of row gutter |
|
2059 | - $dxColGut = 0x0000; // Size of col gutter |
|
2058 | + $dxRwGut = 0x0000; // Size of row gutter |
|
2059 | + $dxColGut = 0x0000; // Size of col gutter |
|
2060 | 2060 | |
2061 | 2061 | // determine maximum row outline level |
2062 | 2062 | $maxRowOutlineLevel = 0; |
@@ -2064,7 +2064,7 @@ discard block |
||
2064 | 2064 | $maxRowOutlineLevel = max($maxRowOutlineLevel, $rowDimension->getOutlineLevel()); |
2065 | 2065 | } |
2066 | 2066 | |
2067 | - $col_level = 0; |
|
2067 | + $col_level = 0; |
|
2068 | 2068 | |
2069 | 2069 | // Calculate the maximum column outline level. The equivalent calculation |
2070 | 2070 | // for the row outline level is carried out in writeRow(). |
@@ -2087,7 +2087,7 @@ discard block |
||
2087 | 2087 | $header = pack("vv", $record, $length); |
2088 | 2088 | $data = pack("vvvv", $dxRwGut, $dxColGut, $maxRowOutlineLevel, $col_level); |
2089 | 2089 | |
2090 | - $this->append($header.$data); |
|
2090 | + $this->append($header . $data); |
|
2091 | 2091 | } |
2092 | 2092 | |
2093 | 2093 | /** |
@@ -2096,15 +2096,15 @@ discard block |
||
2096 | 2096 | */ |
2097 | 2097 | private function writeWsbool() |
2098 | 2098 | { |
2099 | - $record = 0x0081; // Record identifier |
|
2100 | - $length = 0x0002; // Bytes to follow |
|
2099 | + $record = 0x0081; // Record identifier |
|
2100 | + $length = 0x0002; // Bytes to follow |
|
2101 | 2101 | $grbit = 0x0000; |
2102 | 2102 | |
2103 | 2103 | // The only option that is of interest is the flag for fit to page. So we |
2104 | 2104 | // set all the options in one go. |
2105 | 2105 | // |
2106 | 2106 | // Set the option flags |
2107 | - $grbit |= 0x0001; // Auto page breaks visible |
|
2107 | + $grbit |= 0x0001; // Auto page breaks visible |
|
2108 | 2108 | if ($this->outlineStyle) { |
2109 | 2109 | $grbit |= 0x0020; // Auto outline styles |
2110 | 2110 | } |
@@ -2164,9 +2164,9 @@ discard block |
||
2164 | 2164 | array_shift($hbreaks); |
2165 | 2165 | } |
2166 | 2166 | |
2167 | - $record = 0x001b; // Record identifier |
|
2168 | - $cbrk = count($hbreaks); // Number of page breaks |
|
2169 | - $length = 2 + 6 * $cbrk; // Bytes to follow |
|
2167 | + $record = 0x001b; // Record identifier |
|
2168 | + $cbrk = count($hbreaks); // Number of page breaks |
|
2169 | + $length = 2 + 6 * $cbrk; // Bytes to follow |
|
2170 | 2170 | |
2171 | 2171 | $header = pack("vv", $record, $length); |
2172 | 2172 | $data = pack("v", $cbrk); |
@@ -2191,9 +2191,9 @@ discard block |
||
2191 | 2191 | array_shift($vbreaks); |
2192 | 2192 | } |
2193 | 2193 | |
2194 | - $record = 0x001a; // Record identifier |
|
2195 | - $cbrk = count($vbreaks); // Number of page breaks |
|
2196 | - $length = 2 + 6 * $cbrk; // Bytes to follow |
|
2194 | + $record = 0x001a; // Record identifier |
|
2195 | + $cbrk = count($vbreaks); // Number of page breaks |
|
2196 | + $length = 2 + 6 * $cbrk; // Bytes to follow |
|
2197 | 2197 | |
2198 | 2198 | $header = pack("vv", $record, $length); |
2199 | 2199 | $data = pack("v", $cbrk); |
@@ -2217,15 +2217,15 @@ discard block |
||
2217 | 2217 | return; |
2218 | 2218 | } |
2219 | 2219 | |
2220 | - $record = 0x0012; // Record identifier |
|
2221 | - $length = 0x0002; // Bytes to follow |
|
2220 | + $record = 0x0012; // Record identifier |
|
2221 | + $length = 0x0002; // Bytes to follow |
|
2222 | 2222 | |
2223 | - $fLock = 1; // Worksheet is protected |
|
2223 | + $fLock = 1; // Worksheet is protected |
|
2224 | 2224 | |
2225 | - $header = pack("vv", $record, $length); |
|
2226 | - $data = pack("v", $fLock); |
|
2225 | + $header = pack("vv", $record, $length); |
|
2226 | + $data = pack("v", $fLock); |
|
2227 | 2227 | |
2228 | - $this->append($header.$data); |
|
2228 | + $this->append($header . $data); |
|
2229 | 2229 | } |
2230 | 2230 | |
2231 | 2231 | /** |
@@ -2286,10 +2286,10 @@ discard block |
||
2286 | 2286 | return; |
2287 | 2287 | } |
2288 | 2288 | |
2289 | - $record = 0x0013; // Record identifier |
|
2290 | - $length = 0x0002; // Bytes to follow |
|
2289 | + $record = 0x0013; // Record identifier |
|
2290 | + $length = 0x0002; // Bytes to follow |
|
2291 | 2291 | |
2292 | - $wPassword = hexdec($this->phpSheet->getProtection()->getPassword()); // Encoded password |
|
2292 | + $wPassword = hexdec($this->phpSheet->getProtection()->getPassword()); // Encoded password |
|
2293 | 2293 | |
2294 | 2294 | $header = pack("vv", $record, $length); |
2295 | 2295 | $data = pack("v", $wPassword); |
@@ -2329,7 +2329,7 @@ discard block |
||
2329 | 2329 | $lcb = $size; |
2330 | 2330 | |
2331 | 2331 | $header = pack("vvvvV", $record, $length, $cf, $env, $lcb); |
2332 | - $this->append($header.$data); |
|
2332 | + $this->append($header . $data); |
|
2333 | 2333 | } |
2334 | 2334 | |
2335 | 2335 | /** |
@@ -2386,8 +2386,8 @@ discard block |
||
2386 | 2386 | public function positionImage($col_start, $row_start, $x1, $y1, $width, $height) |
2387 | 2387 | { |
2388 | 2388 | // Initialise end cell to the same as the start cell |
2389 | - $col_end = $col_start; // Col containing lower right corner of object |
|
2390 | - $row_end = $row_start; // Row containing bottom right corner of object |
|
2389 | + $col_end = $col_start; // Col containing lower right corner of object |
|
2390 | + $row_end = $row_start; // Row containing bottom right corner of object |
|
2391 | 2391 | |
2392 | 2392 | // Zero the specified offset if greater than the cell dimensions |
2393 | 2393 | if ($x1 >= \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) { |
@@ -2397,8 +2397,8 @@ discard block |
||
2397 | 2397 | $y1 = 0; |
2398 | 2398 | } |
2399 | 2399 | |
2400 | - $width = $width + $x1 -1; |
|
2401 | - $height = $height + $y1 -1; |
|
2400 | + $width = $width + $x1 - 1; |
|
2401 | + $height = $height + $y1 - 1; |
|
2402 | 2402 | |
2403 | 2403 | // Subtract the underlying cell widths to find the end cell of the image |
2404 | 2404 | while ($width >= \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))) { |
@@ -2418,21 +2418,21 @@ discard block |
||
2418 | 2418 | if (\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) == 0) { |
2419 | 2419 | return; |
2420 | 2420 | } |
2421 | - if (\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) == 0) { |
|
2421 | + if (\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) == 0) { |
|
2422 | 2422 | return; |
2423 | 2423 | } |
2424 | 2424 | if (\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1) == 0) { |
2425 | 2425 | return; |
2426 | 2426 | } |
2427 | - if (\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1) == 0) { |
|
2427 | + if (\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1) == 0) { |
|
2428 | 2428 | return; |
2429 | 2429 | } |
2430 | 2430 | |
2431 | 2431 | // Convert the pixel values to the percentage value expected by Excel |
2432 | - $x1 = $x1 / \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) * 1024; |
|
2433 | - $y1 = $y1 / \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1) * 256; |
|
2434 | - $x2 = $width / \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object |
|
2435 | - $y2 = $height / \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1) * 256; // Distance to bottom of object |
|
2432 | + $x1 = $x1 / \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) * 1024; |
|
2433 | + $y1 = $y1 / \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1) * 256; |
|
2434 | + $x2 = $width / \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object |
|
2435 | + $y2 = $height / \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1) * 256; // Distance to bottom of object |
|
2436 | 2436 | |
2437 | 2437 | $this->writeObjPicture($col_start, $x1, $row_start, $y1, $col_end, $x2, $row_end, $y2); |
2438 | 2438 | } |
@@ -2452,33 +2452,33 @@ discard block |
||
2452 | 2452 | */ |
2453 | 2453 | private function writeObjPicture($colL, $dxL, $rwT, $dyT, $colR, $dxR, $rwB, $dyB) |
2454 | 2454 | { |
2455 | - $record = 0x005d; // Record identifier |
|
2456 | - $length = 0x003c; // Bytes to follow |
|
2457 | - |
|
2458 | - $cObj = 0x0001; // Count of objects in file (set to 1) |
|
2459 | - $OT = 0x0008; // Object type. 8 = Picture |
|
2460 | - $id = 0x0001; // Object ID |
|
2461 | - $grbit = 0x0614; // Option flags |
|
2462 | - |
|
2463 | - $cbMacro = 0x0000; // Length of FMLA structure |
|
2464 | - $Reserved1 = 0x0000; // Reserved |
|
2465 | - $Reserved2 = 0x0000; // Reserved |
|
2466 | - |
|
2467 | - $icvBack = 0x09; // Background colour |
|
2468 | - $icvFore = 0x09; // Foreground colour |
|
2469 | - $fls = 0x00; // Fill pattern |
|
2470 | - $fAuto = 0x00; // Automatic fill |
|
2471 | - $icv = 0x08; // Line colour |
|
2472 | - $lns = 0xff; // Line style |
|
2473 | - $lnw = 0x01; // Line weight |
|
2474 | - $fAutoB = 0x00; // Automatic border |
|
2475 | - $frs = 0x0000; // Frame style |
|
2476 | - $cf = 0x0009; // Image format, 9 = bitmap |
|
2477 | - $Reserved3 = 0x0000; // Reserved |
|
2478 | - $cbPictFmla = 0x0000; // Length of FMLA structure |
|
2479 | - $Reserved4 = 0x0000; // Reserved |
|
2480 | - $grbit2 = 0x0001; // Option flags |
|
2481 | - $Reserved5 = 0x0000; // Reserved |
|
2455 | + $record = 0x005d; // Record identifier |
|
2456 | + $length = 0x003c; // Bytes to follow |
|
2457 | + |
|
2458 | + $cObj = 0x0001; // Count of objects in file (set to 1) |
|
2459 | + $OT = 0x0008; // Object type. 8 = Picture |
|
2460 | + $id = 0x0001; // Object ID |
|
2461 | + $grbit = 0x0614; // Option flags |
|
2462 | + |
|
2463 | + $cbMacro = 0x0000; // Length of FMLA structure |
|
2464 | + $Reserved1 = 0x0000; // Reserved |
|
2465 | + $Reserved2 = 0x0000; // Reserved |
|
2466 | + |
|
2467 | + $icvBack = 0x09; // Background colour |
|
2468 | + $icvFore = 0x09; // Foreground colour |
|
2469 | + $fls = 0x00; // Fill pattern |
|
2470 | + $fAuto = 0x00; // Automatic fill |
|
2471 | + $icv = 0x08; // Line colour |
|
2472 | + $lns = 0xff; // Line style |
|
2473 | + $lnw = 0x01; // Line weight |
|
2474 | + $fAutoB = 0x00; // Automatic border |
|
2475 | + $frs = 0x0000; // Frame style |
|
2476 | + $cf = 0x0009; // Image format, 9 = bitmap |
|
2477 | + $Reserved3 = 0x0000; // Reserved |
|
2478 | + $cbPictFmla = 0x0000; // Length of FMLA structure |
|
2479 | + $Reserved4 = 0x0000; // Reserved |
|
2480 | + $grbit2 = 0x0001; // Option flags |
|
2481 | + $Reserved5 = 0x0000; // Reserved |
|
2482 | 2482 | |
2483 | 2483 | |
2484 | 2484 | $header = pack("vv", $record, $length); |
@@ -2529,16 +2529,16 @@ discard block |
||
2529 | 2529 | $height = imagesy($image); |
2530 | 2530 | |
2531 | 2531 | $data = pack("Vvvvv", 0x000c, $width, $height, 0x01, 0x18); |
2532 | - for ($j=$height; $j--;) { |
|
2533 | - for ($i=0; $i < $width; ++$i) { |
|
2532 | + for ($j = $height; $j--;) { |
|
2533 | + for ($i = 0; $i < $width; ++$i) { |
|
2534 | 2534 | $color = imagecolorsforindex($image, imagecolorat($image, $i, $j)); |
2535 | 2535 | foreach (array("red", "green", "blue") as $key) { |
2536 | 2536 | $color[$key] = $color[$key] + round((255 - $color[$key]) * $color["alpha"] / 127); |
2537 | 2537 | } |
2538 | 2538 | $data .= chr($color["blue"]) . chr($color["green"]) . chr($color["red"]); |
2539 | 2539 | } |
2540 | - if (3*$width % 4) { |
|
2541 | - $data .= str_repeat("\x00", 4 - 3*$width % 4); |
|
2540 | + if (3 * $width % 4) { |
|
2541 | + $data .= str_repeat("\x00", 4 - 3 * $width % 4); |
|
2542 | 2542 | } |
2543 | 2543 | } |
2544 | 2544 | |
@@ -2582,7 +2582,7 @@ discard block |
||
2582 | 2582 | // Read and remove the bitmap size. This is more reliable than reading |
2583 | 2583 | // the data size at offset 0x22. |
2584 | 2584 | // |
2585 | - $size_array = unpack("Vsa", substr($data, 0, 4)); |
|
2585 | + $size_array = unpack("Vsa", substr($data, 0, 4)); |
|
2586 | 2586 | $size = $size_array['sa']; |
2587 | 2587 | $data = substr($data, 4); |
2588 | 2588 | $size -= 0x36; // Subtract size of bitmap header. |
@@ -2643,8 +2643,8 @@ discard block |
||
2643 | 2643 | return; |
2644 | 2644 | } |
2645 | 2645 | |
2646 | - $record = 0x00A0; // Record identifier |
|
2647 | - $length = 0x0004; // Bytes to follow |
|
2646 | + $record = 0x00A0; // Record identifier |
|
2647 | + $length = 0x0004; // Bytes to follow |
|
2648 | 2648 | |
2649 | 2649 | $header = pack("vv", $record, $length); |
2650 | 2650 | $data = pack("vv", $this->phpSheet->getSheetView()->getZoomScale(), 100); |
@@ -2689,10 +2689,10 @@ discard block |
||
2689 | 2689 | $nm = count($spOffsets) - 1; // number of shapes excluding first shape |
2690 | 2690 | for ($i = 1; $i <= $nm; ++$i) { |
2691 | 2691 | // MSODRAWING record |
2692 | - $record = 0x00EC; // Record identifier |
|
2692 | + $record = 0x00EC; // Record identifier |
|
2693 | 2693 | |
2694 | 2694 | // chunk of Escher stream for one shape |
2695 | - $dataChunk = substr($data, $spOffsets[$i -1], $spOffsets[$i] - $spOffsets[$i - 1]); |
|
2695 | + $dataChunk = substr($data, $spOffsets[$i - 1], $spOffsets[$i] - $spOffsets[$i - 1]); |
|
2696 | 2696 | |
2697 | 2697 | $length = strlen($dataChunk); |
2698 | 2698 | $header = pack("vv", $record, $length); |
@@ -2767,20 +2767,20 @@ discard block |
||
2767 | 2767 | // Write data validations? |
2768 | 2768 | if (!empty($dataValidationCollection)) { |
2769 | 2769 | // DATAVALIDATIONS record |
2770 | - $record = 0x01B2; // Record identifier |
|
2771 | - $length = 0x0012; // Bytes to follow |
|
2770 | + $record = 0x01B2; // Record identifier |
|
2771 | + $length = 0x0012; // Bytes to follow |
|
2772 | 2772 | |
2773 | - $grbit = 0x0000; // Prompt box at cell, no cached validity data at DV records |
|
2774 | - $horPos = 0x00000000; // Horizontal position of prompt box, if fixed position |
|
2775 | - $verPos = 0x00000000; // Vertical position of prompt box, if fixed position |
|
2776 | - $objId = 0xFFFFFFFF; // Object identifier of drop down arrow object, or -1 if not visible |
|
2773 | + $grbit = 0x0000; // Prompt box at cell, no cached validity data at DV records |
|
2774 | + $horPos = 0x00000000; // Horizontal position of prompt box, if fixed position |
|
2775 | + $verPos = 0x00000000; // Vertical position of prompt box, if fixed position |
|
2776 | + $objId = 0xFFFFFFFF; // Object identifier of drop down arrow object, or -1 if not visible |
|
2777 | 2777 | |
2778 | 2778 | $header = pack('vv', $record, $length); |
2779 | 2779 | $data = pack('vVVVV', $grbit, $horPos, $verPos, $objId, count($dataValidationCollection)); |
2780 | - $this->append($header.$data); |
|
2780 | + $this->append($header . $data); |
|
2781 | 2781 | |
2782 | 2782 | // DATAVALIDATION records |
2783 | - $record = 0x01BE; // Record identifier |
|
2783 | + $record = 0x01BE; // Record identifier |
|
2784 | 2784 | |
2785 | 2785 | foreach ($dataValidationCollection as $cellCoordinate => $dataValidation) { |
2786 | 2786 | // initialize record data |
@@ -2980,8 +2980,8 @@ discard block |
||
2980 | 2980 | */ |
2981 | 2981 | private function writePageLayoutView() |
2982 | 2982 | { |
2983 | - $record = 0x088B; // Record identifier |
|
2984 | - $length = 0x0010; // Bytes to follow |
|
2983 | + $record = 0x088B; // Record identifier |
|
2984 | + $length = 0x0010; // Bytes to follow |
|
2985 | 2985 | |
2986 | 2986 | $rt = 0x088B; // 2 |
2987 | 2987 | $grbitFrt = 0x0000; // 2 |
@@ -2997,12 +2997,12 @@ discard block |
||
2997 | 2997 | $fRulerVisible = 0; |
2998 | 2998 | $fWhitespaceHidden = 0; |
2999 | 2999 | |
3000 | - $grbit = $fPageLayoutView; // 2 |
|
3001 | - $grbit |= $fRulerVisible << 1; |
|
3002 | - $grbit |= $fWhitespaceHidden << 3; |
|
3000 | + $grbit = $fPageLayoutView; // 2 |
|
3001 | + $grbit |= $fRulerVisible << 1; |
|
3002 | + $grbit |= $fWhitespaceHidden << 3; |
|
3003 | 3003 | |
3004 | - $header = pack("vv", $record, $length); |
|
3005 | - $data = pack("vvVVvv", $rt, $grbitFrt, 0x00000000, 0x00000000, $wScalvePLV, $grbit); |
|
3004 | + $header = pack("vv", $record, $length); |
|
3005 | + $data = pack("vvVVvv", $rt, $grbitFrt, 0x00000000, 0x00000000, $wScalvePLV, $grbit); |
|
3006 | 3006 | $this->append($header . $data); |
3007 | 3007 | } |
3008 | 3008 | |
@@ -3012,7 +3012,7 @@ discard block |
||
3012 | 3012 | */ |
3013 | 3013 | private function writeCFRule(\PhpSpreadsheet\Style\Conditional $conditional) |
3014 | 3014 | { |
3015 | - $record = 0x01B1; // Record identifier |
|
3015 | + $record = 0x01B1; // Record identifier |
|
3016 | 3016 | |
3017 | 3017 | // $type : Type of the CF |
3018 | 3018 | // $operatorType : Comparison operator |
@@ -3132,49 +3132,49 @@ discard block |
||
3132 | 3132 | } |
3133 | 3133 | // Alignment |
3134 | 3134 | $flags = 0; |
3135 | - $flags |= (1 == $bAlignHz ? 0x00000001 : 0); |
|
3136 | - $flags |= (1 == $bAlignVt ? 0x00000002 : 0); |
|
3137 | - $flags |= (1 == $bAlignWrapTx ? 0x00000004 : 0); |
|
3138 | - $flags |= (1 == $bTxRotation ? 0x00000008 : 0); |
|
3135 | + $flags |= (1 == $bAlignHz ? 0x00000001 : 0); |
|
3136 | + $flags |= (1 == $bAlignVt ? 0x00000002 : 0); |
|
3137 | + $flags |= (1 == $bAlignWrapTx ? 0x00000004 : 0); |
|
3138 | + $flags |= (1 == $bTxRotation ? 0x00000008 : 0); |
|
3139 | 3139 | // Justify last line flag |
3140 | - $flags |= (1 == 1 ? 0x00000010 : 0); |
|
3141 | - $flags |= (1 == $bIndent ? 0x00000020 : 0); |
|
3142 | - $flags |= (1 == $bShrinkToFit ? 0x00000040 : 0); |
|
3140 | + $flags |= (1 == 1 ? 0x00000010 : 0); |
|
3141 | + $flags |= (1 == $bIndent ? 0x00000020 : 0); |
|
3142 | + $flags |= (1 == $bShrinkToFit ? 0x00000040 : 0); |
|
3143 | 3143 | // Default |
3144 | - $flags |= (1 == 1 ? 0x00000080 : 0); |
|
3144 | + $flags |= (1 == 1 ? 0x00000080 : 0); |
|
3145 | 3145 | // Protection |
3146 | - $flags |= (1 == $bProtLocked ? 0x00000100 : 0); |
|
3147 | - $flags |= (1 == $bProtHidden ? 0x00000200 : 0); |
|
3146 | + $flags |= (1 == $bProtLocked ? 0x00000100 : 0); |
|
3147 | + $flags |= (1 == $bProtHidden ? 0x00000200 : 0); |
|
3148 | 3148 | // Border |
3149 | - $flags |= (1 == $bBorderLeft ? 0x00000400 : 0); |
|
3150 | - $flags |= (1 == $bBorderRight ? 0x00000800 : 0); |
|
3151 | - $flags |= (1 == $bBorderTop ? 0x00001000 : 0); |
|
3149 | + $flags |= (1 == $bBorderLeft ? 0x00000400 : 0); |
|
3150 | + $flags |= (1 == $bBorderRight ? 0x00000800 : 0); |
|
3151 | + $flags |= (1 == $bBorderTop ? 0x00001000 : 0); |
|
3152 | 3152 | $flags |= (1 == $bBorderBottom ? 0x00002000 : 0); |
3153 | - $flags |= (1 == 1 ? 0x00004000 : 0); // Top left to Bottom right border |
|
3154 | - $flags |= (1 == 1 ? 0x00008000 : 0); // Bottom left to Top right border |
|
3153 | + $flags |= (1 == 1 ? 0x00004000 : 0); // Top left to Bottom right border |
|
3154 | + $flags |= (1 == 1 ? 0x00008000 : 0); // Bottom left to Top right border |
|
3155 | 3155 | // Pattern |
3156 | - $flags |= (1 == $bFillStyle ? 0x00010000 : 0); |
|
3157 | - $flags |= (1 == $bFillColor ? 0x00020000 : 0); |
|
3158 | - $flags |= (1 == $bFillColorBg ? 0x00040000 : 0); |
|
3159 | - $flags |= (1 == 1 ? 0x00380000 : 0); |
|
3156 | + $flags |= (1 == $bFillStyle ? 0x00010000 : 0); |
|
3157 | + $flags |= (1 == $bFillColor ? 0x00020000 : 0); |
|
3158 | + $flags |= (1 == $bFillColorBg ? 0x00040000 : 0); |
|
3159 | + $flags |= (1 == 1 ? 0x00380000 : 0); |
|
3160 | 3160 | // Font |
3161 | - $flags |= (1 == $bFormatFont ? 0x04000000 : 0); |
|
3161 | + $flags |= (1 == $bFormatFont ? 0x04000000 : 0); |
|
3162 | 3162 | // Alignment: |
3163 | - $flags |= (1 == $bFormatAlign ? 0x08000000 : 0); |
|
3163 | + $flags |= (1 == $bFormatAlign ? 0x08000000 : 0); |
|
3164 | 3164 | // Border |
3165 | 3165 | $flags |= (1 == $bFormatBorder ? 0x10000000 : 0); |
3166 | 3166 | // Pattern |
3167 | - $flags |= (1 == $bFormatFill ? 0x20000000 : 0); |
|
3167 | + $flags |= (1 == $bFormatFill ? 0x20000000 : 0); |
|
3168 | 3168 | // Protection |
3169 | - $flags |= (1 == $bFormatProt ? 0x40000000 : 0); |
|
3169 | + $flags |= (1 == $bFormatProt ? 0x40000000 : 0); |
|
3170 | 3170 | // Text direction |
3171 | - $flags |= (1 == 0 ? 0x80000000 : 0); |
|
3171 | + $flags |= (1 == 0 ? 0x80000000 : 0); |
|
3172 | 3172 | |
3173 | 3173 | // Data Blocks |
3174 | 3174 | if ($bFormatFont == 1) { |
3175 | 3175 | // Font Name |
3176 | 3176 | if ($conditional->getStyle()->getFont()->getName() == null) { |
3177 | - $dataBlockFont = pack('VVVVVVVV', 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000); |
|
3177 | + $dataBlockFont = pack('VVVVVVVV', 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000); |
|
3178 | 3178 | $dataBlockFont .= pack('VVVVVVVV', 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000); |
3179 | 3179 | } else { |
3180 | 3180 | $dataBlockFont = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($conditional->getStyle()->getFont()->getName()); |
@@ -3413,11 +3413,11 @@ discard block |
||
3413 | 3413 | // Options flags for modified font attributes |
3414 | 3414 | $optionsFlags = 0; |
3415 | 3415 | $optionsFlagsBold = ($conditional->getStyle()->getFont()->getBold() == null ? 1 : 0); |
3416 | - $optionsFlags |= (1 == $optionsFlagsBold ? 0x00000002 : 0); |
|
3417 | - $optionsFlags |= (1 == 1 ? 0x00000008 : 0); |
|
3418 | - $optionsFlags |= (1 == 1 ? 0x00000010 : 0); |
|
3419 | - $optionsFlags |= (1 == 0 ? 0x00000020 : 0); |
|
3420 | - $optionsFlags |= (1 == 1 ? 0x00000080 : 0); |
|
3416 | + $optionsFlags |= (1 == $optionsFlagsBold ? 0x00000002 : 0); |
|
3417 | + $optionsFlags |= (1 == 1 ? 0x00000008 : 0); |
|
3418 | + $optionsFlags |= (1 == 1 ? 0x00000010 : 0); |
|
3419 | + $optionsFlags |= (1 == 0 ? 0x00000020 : 0); |
|
3420 | + $optionsFlags |= (1 == 1 ? 0x00000080 : 0); |
|
3421 | 3421 | $dataBlockFont .= pack('V', $optionsFlags); |
3422 | 3422 | // Escapement type |
3423 | 3423 | $dataBlockFont .= pack('V', $fontEscapement); |
@@ -3788,10 +3788,10 @@ discard block |
||
3788 | 3788 | break; |
3789 | 3789 | case \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR: |
3790 | 3790 | $blockFillPatternStyle = 0x00; |
3791 | - break; // does not exist in BIFF8 |
|
3791 | + break; // does not exist in BIFF8 |
|
3792 | 3792 | case \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH: |
3793 | 3793 | $blockFillPatternStyle = 0x00; |
3794 | - break; // does not exist in BIFF8 |
|
3794 | + break; // does not exist in BIFF8 |
|
3795 | 3795 | default: |
3796 | 3796 | $blockFillPatternStyle = 0x00; |
3797 | 3797 | break; |
@@ -4179,7 +4179,7 @@ discard block |
||
4179 | 4179 | if (!is_null($operand2)) { |
4180 | 4180 | $data .= $operand2; |
4181 | 4181 | } |
4182 | - $header = pack('vv', $record, strlen($data)); |
|
4182 | + $header = pack('vv', $record, strlen($data)); |
|
4183 | 4183 | $this->append($header . $data); |
4184 | 4184 | } |
4185 | 4185 | |
@@ -4188,8 +4188,8 @@ discard block |
||
4188 | 4188 | */ |
4189 | 4189 | private function writeCFHeader() |
4190 | 4190 | { |
4191 | - $record = 0x01B0; // Record identifier |
|
4192 | - $length = 0x0016; // Bytes to follow |
|
4191 | + $record = 0x01B0; // Record identifier |
|
4192 | + $length = 0x0016; // Bytes to follow |
|
4193 | 4193 | |
4194 | 4194 | $numColumnMin = null; |
4195 | 4195 | $numColumnMax = null; |
@@ -4224,9 +4224,9 @@ discard block |
||
4224 | 4224 | } |
4225 | 4225 | } |
4226 | 4226 | $needRedraw = 1; |
4227 | - $cellRange = pack('vvvv', $numRowMin-1, $numRowMax-1, $numColumnMin-1, $numColumnMax-1); |
|
4227 | + $cellRange = pack('vvvv', $numRowMin - 1, $numRowMax - 1, $numColumnMin - 1, $numColumnMax - 1); |
|
4228 | 4228 | |
4229 | - $header = pack('vv', $record, $length); |
|
4229 | + $header = pack('vv', $record, $length); |
|
4230 | 4230 | $data = pack('vv', count($arrConditional), $needRedraw); |
4231 | 4231 | $data .= $cellRange; |
4232 | 4232 | $data .= pack('v', 0x0001); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | // It needs to call its parent's constructor explicitly |
199 | 199 | parent::__construct(); |
200 | 200 | |
201 | - $this->parser = $parser; |
|
201 | + $this->parser = $parser; |
|
202 | 202 | $this->biffSize = 0; |
203 | 203 | $this->palette = array(); |
204 | 204 | $this->countryCode = -1; |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $this->stringTotal = &$str_total; |
207 | 207 | $this->stringUnique = &$str_unique; |
208 | 208 | $this->stringTable = &$str_table; |
209 | - $this->colors = &$colors; |
|
209 | + $this->colors = &$colors; |
|
210 | 210 | $this->setPaletteXl97(); |
211 | 211 | |
212 | 212 | $this->spreadsheet = $spreadsheet; |
@@ -220,11 +220,11 @@ discard block |
||
220 | 220 | for ($i = 0; $i < $countSheets; ++$i) { |
221 | 221 | $phpSheet = $spreadsheet->getSheet($i); |
222 | 222 | |
223 | - $this->parser->setExtSheet($phpSheet->getTitle(), $i); // Register worksheet name with parser |
|
223 | + $this->parser->setExtSheet($phpSheet->getTitle(), $i); // Register worksheet name with parser |
|
224 | 224 | |
225 | 225 | $supbook_index = 0x00; |
226 | 226 | $ref = pack('vvv', $supbook_index, $i, $i); |
227 | - $this->parser->references[] = $ref; // Register reference with parser |
|
227 | + $this->parser->references[] = $ref; // Register reference with parser |
|
228 | 228 | |
229 | 229 | // Sheet tab colors? |
230 | 230 | if ($phpSheet->isTabColorSet()) { |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | */ |
471 | 471 | private function calcSheetOffsets() |
472 | 472 | { |
473 | - $boundsheet_length = 10; // fixed length for a BOUNDSHEET record |
|
473 | + $boundsheet_length = 10; // fixed length for a BOUNDSHEET record |
|
474 | 474 | |
475 | 475 | // size of Workbook globals part 1 + 3 |
476 | 476 | $offset = $this->_datasize; |
@@ -834,9 +834,9 @@ discard block |
||
834 | 834 | $record = 0x0018; |
835 | 835 | |
836 | 836 | // option flags |
837 | - $options = ($isHidden ? 0x21 : 0x00); |
|
837 | + $options = ($isHidden ? 0x21 : 0x00); |
|
838 | 838 | |
839 | - $extra = pack( |
|
839 | + $extra = pack( |
|
840 | 840 | 'Cvvvvv', |
841 | 841 | 0x3B, |
842 | 842 | $sheetIndex - 1, |
@@ -864,9 +864,9 @@ discard block |
||
864 | 864 | */ |
865 | 865 | private function writeCodepage() |
866 | 866 | { |
867 | - $record = 0x0042; // Record identifier |
|
868 | - $length = 0x0002; // Number of bytes to follow |
|
869 | - $cv = $this->codepage; // The code page |
|
867 | + $record = 0x0042; // Record identifier |
|
868 | + $length = 0x0002; // Number of bytes to follow |
|
869 | + $cv = $this->codepage; // The code page |
|
870 | 870 | |
871 | 871 | $header = pack('vv', $record, $length); |
872 | 872 | $data = pack('v', $cv); |
@@ -879,24 +879,24 @@ discard block |
||
879 | 879 | */ |
880 | 880 | private function writeWindow1() |
881 | 881 | { |
882 | - $record = 0x003D; // Record identifier |
|
883 | - $length = 0x0012; // Number of bytes to follow |
|
882 | + $record = 0x003D; // Record identifier |
|
883 | + $length = 0x0012; // Number of bytes to follow |
|
884 | 884 | |
885 | - $xWn = 0x0000; // Horizontal position of window |
|
886 | - $yWn = 0x0000; // Vertical position of window |
|
887 | - $dxWn = 0x25BC; // Width of window |
|
888 | - $dyWn = 0x1572; // Height of window |
|
885 | + $xWn = 0x0000; // Horizontal position of window |
|
886 | + $yWn = 0x0000; // Vertical position of window |
|
887 | + $dxWn = 0x25BC; // Width of window |
|
888 | + $dyWn = 0x1572; // Height of window |
|
889 | 889 | |
890 | - $grbit = 0x0038; // Option flags |
|
890 | + $grbit = 0x0038; // Option flags |
|
891 | 891 | |
892 | 892 | // not supported by PhpSpreadsheet, so there is only one selected sheet, the active |
893 | - $ctabsel = 1; // Number of workbook tabs selected |
|
893 | + $ctabsel = 1; // Number of workbook tabs selected |
|
894 | 894 | |
895 | - $wTabRatio = 0x0258; // Tab to scrollbar ratio |
|
895 | + $wTabRatio = 0x0258; // Tab to scrollbar ratio |
|
896 | 896 | |
897 | 897 | // not supported by PhpSpreadsheet, set to 0 |
898 | - $itabFirst = 0; // 1st displayed worksheet |
|
899 | - $itabCur = $this->spreadsheet->getActiveSheetIndex(); // Active worksheet |
|
898 | + $itabFirst = 0; // 1st displayed worksheet |
|
899 | + $itabCur = $this->spreadsheet->getActiveSheetIndex(); // Active worksheet |
|
900 | 900 | |
901 | 901 | $header = pack("vv", $record, $length); |
902 | 902 | $data = pack("vvvvvvvvv", $xWn, $yWn, $dxWn, $dyWn, $grbit, $itabCur, $itabFirst, $ctabsel, $wTabRatio); |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | private function writeBoundSheet($sheet, $offset) |
913 | 913 | { |
914 | 914 | $sheetname = $sheet->getTitle(); |
915 | - $record = 0x0085; // Record identifier |
|
915 | + $record = 0x0085; // Record identifier |
|
916 | 916 | |
917 | 917 | // sheet state |
918 | 918 | switch ($sheet->getSheetState()) { |
@@ -933,7 +933,7 @@ discard block |
||
933 | 933 | // sheet type |
934 | 934 | $st = 0x00; |
935 | 935 | |
936 | - $grbit = 0x0000; // Visibility and sheet type |
|
936 | + $grbit = 0x0000; // Visibility and sheet type |
|
937 | 937 | |
938 | 938 | $data = pack("VCC", $offset, $ss, $st); |
939 | 939 | $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($sheetname); |
@@ -948,8 +948,8 @@ discard block |
||
948 | 948 | */ |
949 | 949 | private function writeSupbookInternal() |
950 | 950 | { |
951 | - $record = 0x01AE; // Record identifier |
|
952 | - $length = 0x0004; // Bytes to follow |
|
951 | + $record = 0x01AE; // Record identifier |
|
952 | + $length = 0x0004; // Bytes to follow |
|
953 | 953 | |
954 | 954 | $header = pack("vv", $record, $length); |
955 | 955 | $data = pack("vv", $this->spreadsheet->getSheetCount(), 0x0401); |
@@ -964,10 +964,10 @@ discard block |
||
964 | 964 | private function writeExternalsheetBiff8() |
965 | 965 | { |
966 | 966 | $totalReferences = count($this->parser->references); |
967 | - $record = 0x0017; // Record identifier |
|
968 | - $length = 2 + 6 * $totalReferences; // Number of bytes to follow |
|
967 | + $record = 0x0017; // Record identifier |
|
968 | + $length = 2 + 6 * $totalReferences; // Number of bytes to follow |
|
969 | 969 | |
970 | - $supbook_index = 0; // FIXME: only using internal SUPBOOK record |
|
970 | + $supbook_index = 0; // FIXME: only using internal SUPBOOK record |
|
971 | 971 | $header = pack("vv", $record, $length); |
972 | 972 | $data = pack('v', $totalReferences); |
973 | 973 | for ($i = 0; $i < $totalReferences; ++$i) { |
@@ -981,12 +981,12 @@ discard block |
||
981 | 981 | */ |
982 | 982 | private function writeStyle() |
983 | 983 | { |
984 | - $record = 0x0293; // Record identifier |
|
985 | - $length = 0x0004; // Bytes to follow |
|
984 | + $record = 0x0293; // Record identifier |
|
985 | + $length = 0x0004; // Bytes to follow |
|
986 | 986 | |
987 | - $ixfe = 0x8000; // Index to cell style XF |
|
988 | - $BuiltIn = 0x00; // Built-in style |
|
989 | - $iLevel = 0xff; // Outline style level |
|
987 | + $ixfe = 0x8000; // Index to cell style XF |
|
988 | + $BuiltIn = 0x00; // Built-in style |
|
989 | + $iLevel = 0xff; // Outline style level |
|
990 | 990 | |
991 | 991 | $header = pack("vv", $record, $length); |
992 | 992 | $data = pack("vCC", $ixfe, $BuiltIn, $iLevel); |
@@ -1001,14 +1001,14 @@ discard block |
||
1001 | 1001 | */ |
1002 | 1002 | private function writeNumberFormat($format, $ifmt) |
1003 | 1003 | { |
1004 | - $record = 0x041E; // Record identifier |
|
1004 | + $record = 0x041E; // Record identifier |
|
1005 | 1005 | |
1006 | 1006 | $numberFormatString = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($format); |
1007 | - $length = 2 + strlen($numberFormatString); // Number of bytes to follow |
|
1007 | + $length = 2 + strlen($numberFormatString); // Number of bytes to follow |
|
1008 | 1008 | |
1009 | 1009 | |
1010 | 1010 | $header = pack("vv", $record, $length); |
1011 | - $data = pack("v", $ifmt) . $numberFormatString; |
|
1011 | + $data = pack("v", $ifmt) . $numberFormatString; |
|
1012 | 1012 | $this->append($header . $data); |
1013 | 1013 | } |
1014 | 1014 | |
@@ -1017,12 +1017,12 @@ discard block |
||
1017 | 1017 | */ |
1018 | 1018 | private function writeDateMode() |
1019 | 1019 | { |
1020 | - $record = 0x0022; // Record identifier |
|
1021 | - $length = 0x0002; // Bytes to follow |
|
1020 | + $record = 0x0022; // Record identifier |
|
1021 | + $length = 0x0002; // Bytes to follow |
|
1022 | 1022 | |
1023 | 1023 | $f1904 = (\PhpSpreadsheet\Shared\Date::getExcelCalendar() == \PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904) |
1024 | 1024 | ? 1 |
1025 | - : 0; // Flag for 1904 date system |
|
1025 | + : 0; // Flag for 1904 date system |
|
1026 | 1026 | |
1027 | 1027 | $header = pack("vv", $record, $length); |
1028 | 1028 | $data = pack("v", $f1904); |
@@ -1043,8 +1043,8 @@ discard block |
||
1043 | 1043 | */ |
1044 | 1044 | private function writeExternalCount($cxals) |
1045 | 1045 | { |
1046 | - $record = 0x0016; // Record identifier |
|
1047 | - $length = 0x0002; // Number of bytes to follow |
|
1046 | + $record = 0x0016; // Record identifier |
|
1047 | + $length = 0x0002; // Number of bytes to follow |
|
1048 | 1048 | |
1049 | 1049 | $header = pack("vv", $record, $length); |
1050 | 1050 | $data = pack("v", $cxals); |
@@ -1062,11 +1062,11 @@ discard block |
||
1062 | 1062 | */ |
1063 | 1063 | private function writeExternalSheet($sheetname) |
1064 | 1064 | { |
1065 | - $record = 0x0017; // Record identifier |
|
1066 | - $length = 0x02 + strlen($sheetname); // Number of bytes to follow |
|
1065 | + $record = 0x0017; // Record identifier |
|
1066 | + $length = 0x02 + strlen($sheetname); // Number of bytes to follow |
|
1067 | 1067 | |
1068 | - $cch = strlen($sheetname); // Length of sheet name |
|
1069 | - $rgch = 0x03; // Filename encoding |
|
1068 | + $cch = strlen($sheetname); // Length of sheet name |
|
1069 | + $rgch = 0x03; // Filename encoding |
|
1070 | 1070 | |
1071 | 1071 | $header = pack("vv", $record, $length); |
1072 | 1072 | $data = pack("CC", $cch, $rgch); |
@@ -1086,20 +1086,20 @@ discard block |
||
1086 | 1086 | */ |
1087 | 1087 | private function writeNameShort($index, $type, $rowmin, $rowmax, $colmin, $colmax) |
1088 | 1088 | { |
1089 | - $record = 0x0018; // Record identifier |
|
1090 | - $length = 0x0024; // Number of bytes to follow |
|
1091 | - |
|
1092 | - $grbit = 0x0020; // Option flags |
|
1093 | - $chKey = 0x00; // Keyboard shortcut |
|
1094 | - $cch = 0x01; // Length of text name |
|
1095 | - $cce = 0x0015; // Length of text definition |
|
1096 | - $ixals = $index + 1; // Sheet index |
|
1097 | - $itab = $ixals; // Equal to ixals |
|
1098 | - $cchCustMenu = 0x00; // Length of cust menu text |
|
1099 | - $cchDescription = 0x00; // Length of description text |
|
1100 | - $cchHelptopic = 0x00; // Length of help topic text |
|
1101 | - $cchStatustext = 0x00; // Length of status bar text |
|
1102 | - $rgch = $type; // Built-in name type |
|
1089 | + $record = 0x0018; // Record identifier |
|
1090 | + $length = 0x0024; // Number of bytes to follow |
|
1091 | + |
|
1092 | + $grbit = 0x0020; // Option flags |
|
1093 | + $chKey = 0x00; // Keyboard shortcut |
|
1094 | + $cch = 0x01; // Length of text name |
|
1095 | + $cce = 0x0015; // Length of text definition |
|
1096 | + $ixals = $index + 1; // Sheet index |
|
1097 | + $itab = $ixals; // Equal to ixals |
|
1098 | + $cchCustMenu = 0x00; // Length of cust menu text |
|
1099 | + $cchDescription = 0x00; // Length of description text |
|
1100 | + $cchHelptopic = 0x00; // Length of help topic text |
|
1101 | + $cchStatustext = 0x00; // Length of status bar text |
|
1102 | + $rgch = $type; // Built-in name type |
|
1103 | 1103 | |
1104 | 1104 | $unknown03 = 0x3b; |
1105 | 1105 | $unknown04 = 0xffff - $index; |
@@ -1150,24 +1150,24 @@ discard block |
||
1150 | 1150 | */ |
1151 | 1151 | private function writeNameLong($index, $type, $rowmin, $rowmax, $colmin, $colmax) |
1152 | 1152 | { |
1153 | - $record = 0x0018; // Record identifier |
|
1154 | - $length = 0x003d; // Number of bytes to follow |
|
1155 | - $grbit = 0x0020; // Option flags |
|
1156 | - $chKey = 0x00; // Keyboard shortcut |
|
1157 | - $cch = 0x01; // Length of text name |
|
1158 | - $cce = 0x002e; // Length of text definition |
|
1159 | - $ixals = $index + 1; // Sheet index |
|
1160 | - $itab = $ixals; // Equal to ixals |
|
1161 | - $cchCustMenu = 0x00; // Length of cust menu text |
|
1162 | - $cchDescription = 0x00; // Length of description text |
|
1163 | - $cchHelptopic = 0x00; // Length of help topic text |
|
1164 | - $cchStatustext = 0x00; // Length of status bar text |
|
1165 | - $rgch = $type; // Built-in name type |
|
1153 | + $record = 0x0018; // Record identifier |
|
1154 | + $length = 0x003d; // Number of bytes to follow |
|
1155 | + $grbit = 0x0020; // Option flags |
|
1156 | + $chKey = 0x00; // Keyboard shortcut |
|
1157 | + $cch = 0x01; // Length of text name |
|
1158 | + $cce = 0x002e; // Length of text definition |
|
1159 | + $ixals = $index + 1; // Sheet index |
|
1160 | + $itab = $ixals; // Equal to ixals |
|
1161 | + $cchCustMenu = 0x00; // Length of cust menu text |
|
1162 | + $cchDescription = 0x00; // Length of description text |
|
1163 | + $cchHelptopic = 0x00; // Length of help topic text |
|
1164 | + $cchStatustext = 0x00; // Length of status bar text |
|
1165 | + $rgch = $type; // Built-in name type |
|
1166 | 1166 | |
1167 | 1167 | $unknown01 = 0x29; |
1168 | 1168 | $unknown02 = 0x002b; |
1169 | 1169 | $unknown03 = 0x3b; |
1170 | - $unknown04 = 0xffff-$index; |
|
1170 | + $unknown04 = 0xffff - $index; |
|
1171 | 1171 | $unknown05 = 0x0000; |
1172 | 1172 | $unknown06 = 0x0000; |
1173 | 1173 | $unknown07 = 0x1087; |
@@ -1225,8 +1225,8 @@ discard block |
||
1225 | 1225 | */ |
1226 | 1226 | private function writeCountry() |
1227 | 1227 | { |
1228 | - $record = 0x008C; // Record identifier |
|
1229 | - $length = 4; // Number of bytes to follow |
|
1228 | + $record = 0x008C; // Record identifier |
|
1229 | + $length = 4; // Number of bytes to follow |
|
1230 | 1230 | |
1231 | 1231 | $header = pack('vv', $record, $length); |
1232 | 1232 | /* using the same country code always for simplicity */ |
@@ -1242,8 +1242,8 @@ discard block |
||
1242 | 1242 | */ |
1243 | 1243 | private function writeRecalcId() |
1244 | 1244 | { |
1245 | - $record = 0x01C1; // Record identifier |
|
1246 | - $length = 8; // Number of bytes to follow |
|
1245 | + $record = 0x01C1; // Record identifier |
|
1246 | + $length = 8; // Number of bytes to follow |
|
1247 | 1247 | |
1248 | 1248 | $header = pack('vv', $record, $length); |
1249 | 1249 | |
@@ -1260,10 +1260,10 @@ discard block |
||
1260 | 1260 | { |
1261 | 1261 | $aref = $this->palette; |
1262 | 1262 | |
1263 | - $record = 0x0092; // Record identifier |
|
1264 | - $length = 2 + 4 * count($aref); // Number of bytes to follow |
|
1265 | - $ccv = count($aref); // Number of RGB values to follow |
|
1266 | - $data = ''; // The RGB data |
|
1263 | + $record = 0x0092; // Record identifier |
|
1264 | + $length = 2 + 4 * count($aref); // Number of bytes to follow |
|
1265 | + $ccv = count($aref); // Number of RGB values to follow |
|
1266 | + $data = ''; // The RGB data |
|
1267 | 1267 | |
1268 | 1268 | // Pack the RGB data |
1269 | 1269 | foreach ($aref as $color) { |
@@ -114,12 +114,12 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function __construct() |
116 | 116 | { |
117 | - $this->currentCharacter = 0; |
|
118 | - $this->currentToken = ''; // The token we are working on. |
|
119 | - $this->formula = ''; // The formula to parse. |
|
120 | - $this->lookAhead = ''; // The character ahead of the current char. |
|
121 | - $this->parseTree = ''; // The parse tree to be generated. |
|
122 | - $this->initializeHashes(); // Initialize the hashes: ptg's and function's ptg's |
|
117 | + $this->currentCharacter = 0; |
|
118 | + $this->currentToken = ''; // The token we are working on. |
|
119 | + $this->formula = ''; // The formula to parse. |
|
120 | + $this->lookAhead = ''; // The character ahead of the current char. |
|
121 | + $this->parseTree = ''; // The parse tree to be generated. |
|
122 | + $this->initializeHashes(); // Initialize the hashes: ptg's and function's ptg's |
|
123 | 123 | $this->externalSheets = array(); |
124 | 124 | $this->references = array(); |
125 | 125 | } |
@@ -245,256 +245,256 @@ discard block |
||
245 | 245 | // |
246 | 246 | $this->functions = array( |
247 | 247 | // function ptg args class vol |
248 | - 'COUNT' => array( 0, -1, 0, 0 ), |
|
249 | - 'IF' => array( 1, -1, 1, 0 ), |
|
250 | - 'ISNA' => array( 2, 1, 1, 0 ), |
|
251 | - 'ISERROR' => array( 3, 1, 1, 0 ), |
|
252 | - 'SUM' => array( 4, -1, 0, 0 ), |
|
253 | - 'AVERAGE' => array( 5, -1, 0, 0 ), |
|
254 | - 'MIN' => array( 6, -1, 0, 0 ), |
|
255 | - 'MAX' => array( 7, -1, 0, 0 ), |
|
256 | - 'ROW' => array( 8, -1, 0, 0 ), |
|
257 | - 'COLUMN' => array( 9, -1, 0, 0 ), |
|
258 | - 'NA' => array( 10, 0, 0, 0 ), |
|
259 | - 'NPV' => array( 11, -1, 1, 0 ), |
|
260 | - 'STDEV' => array( 12, -1, 0, 0 ), |
|
261 | - 'DOLLAR' => array( 13, -1, 1, 0 ), |
|
262 | - 'FIXED' => array( 14, -1, 1, 0 ), |
|
263 | - 'SIN' => array( 15, 1, 1, 0 ), |
|
264 | - 'COS' => array( 16, 1, 1, 0 ), |
|
265 | - 'TAN' => array( 17, 1, 1, 0 ), |
|
266 | - 'ATAN' => array( 18, 1, 1, 0 ), |
|
267 | - 'PI' => array( 19, 0, 1, 0 ), |
|
268 | - 'SQRT' => array( 20, 1, 1, 0 ), |
|
269 | - 'EXP' => array( 21, 1, 1, 0 ), |
|
270 | - 'LN' => array( 22, 1, 1, 0 ), |
|
271 | - 'LOG10' => array( 23, 1, 1, 0 ), |
|
272 | - 'ABS' => array( 24, 1, 1, 0 ), |
|
273 | - 'INT' => array( 25, 1, 1, 0 ), |
|
274 | - 'SIGN' => array( 26, 1, 1, 0 ), |
|
275 | - 'ROUND' => array( 27, 2, 1, 0 ), |
|
276 | - 'LOOKUP' => array( 28, -1, 0, 0 ), |
|
277 | - 'INDEX' => array( 29, -1, 0, 1 ), |
|
278 | - 'REPT' => array( 30, 2, 1, 0 ), |
|
279 | - 'MID' => array( 31, 3, 1, 0 ), |
|
280 | - 'LEN' => array( 32, 1, 1, 0 ), |
|
281 | - 'VALUE' => array( 33, 1, 1, 0 ), |
|
282 | - 'TRUE' => array( 34, 0, 1, 0 ), |
|
283 | - 'FALSE' => array( 35, 0, 1, 0 ), |
|
284 | - 'AND' => array( 36, -1, 0, 0 ), |
|
285 | - 'OR' => array( 37, -1, 0, 0 ), |
|
286 | - 'NOT' => array( 38, 1, 1, 0 ), |
|
287 | - 'MOD' => array( 39, 2, 1, 0 ), |
|
288 | - 'DCOUNT' => array( 40, 3, 0, 0 ), |
|
289 | - 'DSUM' => array( 41, 3, 0, 0 ), |
|
290 | - 'DAVERAGE' => array( 42, 3, 0, 0 ), |
|
291 | - 'DMIN' => array( 43, 3, 0, 0 ), |
|
292 | - 'DMAX' => array( 44, 3, 0, 0 ), |
|
293 | - 'DSTDEV' => array( 45, 3, 0, 0 ), |
|
294 | - 'VAR' => array( 46, -1, 0, 0 ), |
|
295 | - 'DVAR' => array( 47, 3, 0, 0 ), |
|
296 | - 'TEXT' => array( 48, 2, 1, 0 ), |
|
297 | - 'LINEST' => array( 49, -1, 0, 0 ), |
|
298 | - 'TREND' => array( 50, -1, 0, 0 ), |
|
299 | - 'LOGEST' => array( 51, -1, 0, 0 ), |
|
300 | - 'GROWTH' => array( 52, -1, 0, 0 ), |
|
301 | - 'PV' => array( 56, -1, 1, 0 ), |
|
302 | - 'FV' => array( 57, -1, 1, 0 ), |
|
303 | - 'NPER' => array( 58, -1, 1, 0 ), |
|
304 | - 'PMT' => array( 59, -1, 1, 0 ), |
|
305 | - 'RATE' => array( 60, -1, 1, 0 ), |
|
306 | - 'MIRR' => array( 61, 3, 0, 0 ), |
|
307 | - 'IRR' => array( 62, -1, 0, 0 ), |
|
308 | - 'RAND' => array( 63, 0, 1, 1 ), |
|
309 | - 'MATCH' => array( 64, -1, 0, 0 ), |
|
310 | - 'DATE' => array( 65, 3, 1, 0 ), |
|
311 | - 'TIME' => array( 66, 3, 1, 0 ), |
|
312 | - 'DAY' => array( 67, 1, 1, 0 ), |
|
313 | - 'MONTH' => array( 68, 1, 1, 0 ), |
|
314 | - 'YEAR' => array( 69, 1, 1, 0 ), |
|
315 | - 'WEEKDAY' => array( 70, -1, 1, 0 ), |
|
316 | - 'HOUR' => array( 71, 1, 1, 0 ), |
|
317 | - 'MINUTE' => array( 72, 1, 1, 0 ), |
|
318 | - 'SECOND' => array( 73, 1, 1, 0 ), |
|
319 | - 'NOW' => array( 74, 0, 1, 1 ), |
|
320 | - 'AREAS' => array( 75, 1, 0, 1 ), |
|
321 | - 'ROWS' => array( 76, 1, 0, 1 ), |
|
322 | - 'COLUMNS' => array( 77, 1, 0, 1 ), |
|
323 | - 'OFFSET' => array( 78, -1, 0, 1 ), |
|
324 | - 'SEARCH' => array( 82, -1, 1, 0 ), |
|
325 | - 'TRANSPOSE' => array( 83, 1, 1, 0 ), |
|
326 | - 'TYPE' => array( 86, 1, 1, 0 ), |
|
327 | - 'ATAN2' => array( 97, 2, 1, 0 ), |
|
328 | - 'ASIN' => array( 98, 1, 1, 0 ), |
|
329 | - 'ACOS' => array( 99, 1, 1, 0 ), |
|
330 | - 'CHOOSE' => array( 100, -1, 1, 0 ), |
|
331 | - 'HLOOKUP' => array( 101, -1, 0, 0 ), |
|
332 | - 'VLOOKUP' => array( 102, -1, 0, 0 ), |
|
333 | - 'ISREF' => array( 105, 1, 0, 0 ), |
|
334 | - 'LOG' => array( 109, -1, 1, 0 ), |
|
335 | - 'CHAR' => array( 111, 1, 1, 0 ), |
|
336 | - 'LOWER' => array( 112, 1, 1, 0 ), |
|
337 | - 'UPPER' => array( 113, 1, 1, 0 ), |
|
338 | - 'PROPER' => array( 114, 1, 1, 0 ), |
|
339 | - 'LEFT' => array( 115, -1, 1, 0 ), |
|
340 | - 'RIGHT' => array( 116, -1, 1, 0 ), |
|
341 | - 'EXACT' => array( 117, 2, 1, 0 ), |
|
342 | - 'TRIM' => array( 118, 1, 1, 0 ), |
|
343 | - 'REPLACE' => array( 119, 4, 1, 0 ), |
|
344 | - 'SUBSTITUTE' => array( 120, -1, 1, 0 ), |
|
345 | - 'CODE' => array( 121, 1, 1, 0 ), |
|
346 | - 'FIND' => array( 124, -1, 1, 0 ), |
|
347 | - 'CELL' => array( 125, -1, 0, 1 ), |
|
348 | - 'ISERR' => array( 126, 1, 1, 0 ), |
|
349 | - 'ISTEXT' => array( 127, 1, 1, 0 ), |
|
350 | - 'ISNUMBER' => array( 128, 1, 1, 0 ), |
|
351 | - 'ISBLANK' => array( 129, 1, 1, 0 ), |
|
352 | - 'T' => array( 130, 1, 0, 0 ), |
|
353 | - 'N' => array( 131, 1, 0, 0 ), |
|
354 | - 'DATEVALUE' => array( 140, 1, 1, 0 ), |
|
355 | - 'TIMEVALUE' => array( 141, 1, 1, 0 ), |
|
356 | - 'SLN' => array( 142, 3, 1, 0 ), |
|
357 | - 'SYD' => array( 143, 4, 1, 0 ), |
|
358 | - 'DDB' => array( 144, -1, 1, 0 ), |
|
359 | - 'INDIRECT' => array( 148, -1, 1, 1 ), |
|
360 | - 'CALL' => array( 150, -1, 1, 0 ), |
|
361 | - 'CLEAN' => array( 162, 1, 1, 0 ), |
|
362 | - 'MDETERM' => array( 163, 1, 2, 0 ), |
|
363 | - 'MINVERSE' => array( 164, 1, 2, 0 ), |
|
364 | - 'MMULT' => array( 165, 2, 2, 0 ), |
|
365 | - 'IPMT' => array( 167, -1, 1, 0 ), |
|
366 | - 'PPMT' => array( 168, -1, 1, 0 ), |
|
367 | - 'COUNTA' => array( 169, -1, 0, 0 ), |
|
368 | - 'PRODUCT' => array( 183, -1, 0, 0 ), |
|
369 | - 'FACT' => array( 184, 1, 1, 0 ), |
|
370 | - 'DPRODUCT' => array( 189, 3, 0, 0 ), |
|
371 | - 'ISNONTEXT' => array( 190, 1, 1, 0 ), |
|
372 | - 'STDEVP' => array( 193, -1, 0, 0 ), |
|
373 | - 'VARP' => array( 194, -1, 0, 0 ), |
|
374 | - 'DSTDEVP' => array( 195, 3, 0, 0 ), |
|
375 | - 'DVARP' => array( 196, 3, 0, 0 ), |
|
376 | - 'TRUNC' => array( 197, -1, 1, 0 ), |
|
377 | - 'ISLOGICAL' => array( 198, 1, 1, 0 ), |
|
378 | - 'DCOUNTA' => array( 199, 3, 0, 0 ), |
|
379 | - 'USDOLLAR' => array( 204, -1, 1, 0 ), |
|
380 | - 'FINDB' => array( 205, -1, 1, 0 ), |
|
381 | - 'SEARCHB' => array( 206, -1, 1, 0 ), |
|
382 | - 'REPLACEB' => array( 207, 4, 1, 0 ), |
|
383 | - 'LEFTB' => array( 208, -1, 1, 0 ), |
|
384 | - 'RIGHTB' => array( 209, -1, 1, 0 ), |
|
385 | - 'MIDB' => array( 210, 3, 1, 0 ), |
|
386 | - 'LENB' => array( 211, 1, 1, 0 ), |
|
387 | - 'ROUNDUP' => array( 212, 2, 1, 0 ), |
|
388 | - 'ROUNDDOWN' => array( 213, 2, 1, 0 ), |
|
389 | - 'ASC' => array( 214, 1, 1, 0 ), |
|
390 | - 'DBCS' => array( 215, 1, 1, 0 ), |
|
391 | - 'RANK' => array( 216, -1, 0, 0 ), |
|
392 | - 'ADDRESS' => array( 219, -1, 1, 0 ), |
|
393 | - 'DAYS360' => array( 220, -1, 1, 0 ), |
|
394 | - 'TODAY' => array( 221, 0, 1, 1 ), |
|
395 | - 'VDB' => array( 222, -1, 1, 0 ), |
|
396 | - 'MEDIAN' => array( 227, -1, 0, 0 ), |
|
397 | - 'SUMPRODUCT' => array( 228, -1, 2, 0 ), |
|
398 | - 'SINH' => array( 229, 1, 1, 0 ), |
|
399 | - 'COSH' => array( 230, 1, 1, 0 ), |
|
400 | - 'TANH' => array( 231, 1, 1, 0 ), |
|
401 | - 'ASINH' => array( 232, 1, 1, 0 ), |
|
402 | - 'ACOSH' => array( 233, 1, 1, 0 ), |
|
403 | - 'ATANH' => array( 234, 1, 1, 0 ), |
|
404 | - 'DGET' => array( 235, 3, 0, 0 ), |
|
405 | - 'INFO' => array( 244, 1, 1, 1 ), |
|
406 | - 'DB' => array( 247, -1, 1, 0 ), |
|
407 | - 'FREQUENCY' => array( 252, 2, 0, 0 ), |
|
408 | - 'ERROR.TYPE' => array( 261, 1, 1, 0 ), |
|
409 | - 'REGISTER.ID' => array( 267, -1, 1, 0 ), |
|
410 | - 'AVEDEV' => array( 269, -1, 0, 0 ), |
|
411 | - 'BETADIST' => array( 270, -1, 1, 0 ), |
|
412 | - 'GAMMALN' => array( 271, 1, 1, 0 ), |
|
413 | - 'BETAINV' => array( 272, -1, 1, 0 ), |
|
414 | - 'BINOMDIST' => array( 273, 4, 1, 0 ), |
|
415 | - 'CHIDIST' => array( 274, 2, 1, 0 ), |
|
416 | - 'CHIINV' => array( 275, 2, 1, 0 ), |
|
417 | - 'COMBIN' => array( 276, 2, 1, 0 ), |
|
418 | - 'CONFIDENCE' => array( 277, 3, 1, 0 ), |
|
419 | - 'CRITBINOM' => array( 278, 3, 1, 0 ), |
|
420 | - 'EVEN' => array( 279, 1, 1, 0 ), |
|
421 | - 'EXPONDIST' => array( 280, 3, 1, 0 ), |
|
422 | - 'FDIST' => array( 281, 3, 1, 0 ), |
|
423 | - 'FINV' => array( 282, 3, 1, 0 ), |
|
424 | - 'FISHER' => array( 283, 1, 1, 0 ), |
|
425 | - 'FISHERINV' => array( 284, 1, 1, 0 ), |
|
426 | - 'FLOOR' => array( 285, 2, 1, 0 ), |
|
427 | - 'GAMMADIST' => array( 286, 4, 1, 0 ), |
|
428 | - 'GAMMAINV' => array( 287, 3, 1, 0 ), |
|
429 | - 'CEILING' => array( 288, 2, 1, 0 ), |
|
430 | - 'HYPGEOMDIST' => array( 289, 4, 1, 0 ), |
|
431 | - 'LOGNORMDIST' => array( 290, 3, 1, 0 ), |
|
432 | - 'LOGINV' => array( 291, 3, 1, 0 ), |
|
433 | - 'NEGBINOMDIST' => array( 292, 3, 1, 0 ), |
|
434 | - 'NORMDIST' => array( 293, 4, 1, 0 ), |
|
435 | - 'NORMSDIST' => array( 294, 1, 1, 0 ), |
|
436 | - 'NORMINV' => array( 295, 3, 1, 0 ), |
|
437 | - 'NORMSINV' => array( 296, 1, 1, 0 ), |
|
438 | - 'STANDARDIZE' => array( 297, 3, 1, 0 ), |
|
439 | - 'ODD' => array( 298, 1, 1, 0 ), |
|
440 | - 'PERMUT' => array( 299, 2, 1, 0 ), |
|
441 | - 'POISSON' => array( 300, 3, 1, 0 ), |
|
442 | - 'TDIST' => array( 301, 3, 1, 0 ), |
|
443 | - 'WEIBULL' => array( 302, 4, 1, 0 ), |
|
444 | - 'SUMXMY2' => array( 303, 2, 2, 0 ), |
|
445 | - 'SUMX2MY2' => array( 304, 2, 2, 0 ), |
|
446 | - 'SUMX2PY2' => array( 305, 2, 2, 0 ), |
|
447 | - 'CHITEST' => array( 306, 2, 2, 0 ), |
|
448 | - 'CORREL' => array( 307, 2, 2, 0 ), |
|
449 | - 'COVAR' => array( 308, 2, 2, 0 ), |
|
450 | - 'FORECAST' => array( 309, 3, 2, 0 ), |
|
451 | - 'FTEST' => array( 310, 2, 2, 0 ), |
|
452 | - 'INTERCEPT' => array( 311, 2, 2, 0 ), |
|
453 | - 'PEARSON' => array( 312, 2, 2, 0 ), |
|
454 | - 'RSQ' => array( 313, 2, 2, 0 ), |
|
455 | - 'STEYX' => array( 314, 2, 2, 0 ), |
|
456 | - 'SLOPE' => array( 315, 2, 2, 0 ), |
|
457 | - 'TTEST' => array( 316, 4, 2, 0 ), |
|
458 | - 'PROB' => array( 317, -1, 2, 0 ), |
|
459 | - 'DEVSQ' => array( 318, -1, 0, 0 ), |
|
460 | - 'GEOMEAN' => array( 319, -1, 0, 0 ), |
|
461 | - 'HARMEAN' => array( 320, -1, 0, 0 ), |
|
462 | - 'SUMSQ' => array( 321, -1, 0, 0 ), |
|
463 | - 'KURT' => array( 322, -1, 0, 0 ), |
|
464 | - 'SKEW' => array( 323, -1, 0, 0 ), |
|
465 | - 'ZTEST' => array( 324, -1, 0, 0 ), |
|
466 | - 'LARGE' => array( 325, 2, 0, 0 ), |
|
467 | - 'SMALL' => array( 326, 2, 0, 0 ), |
|
468 | - 'QUARTILE' => array( 327, 2, 0, 0 ), |
|
469 | - 'PERCENTILE' => array( 328, 2, 0, 0 ), |
|
470 | - 'PERCENTRANK' => array( 329, -1, 0, 0 ), |
|
471 | - 'MODE' => array( 330, -1, 2, 0 ), |
|
472 | - 'TRIMMEAN' => array( 331, 2, 0, 0 ), |
|
473 | - 'TINV' => array( 332, 2, 1, 0 ), |
|
474 | - 'CONCATENATE' => array( 336, -1, 1, 0 ), |
|
475 | - 'POWER' => array( 337, 2, 1, 0 ), |
|
476 | - 'RADIANS' => array( 342, 1, 1, 0 ), |
|
477 | - 'DEGREES' => array( 343, 1, 1, 0 ), |
|
478 | - 'SUBTOTAL' => array( 344, -1, 0, 0 ), |
|
479 | - 'SUMIF' => array( 345, -1, 0, 0 ), |
|
480 | - 'COUNTIF' => array( 346, 2, 0, 0 ), |
|
481 | - 'COUNTBLANK' => array( 347, 1, 0, 0 ), |
|
482 | - 'ISPMT' => array( 350, 4, 1, 0 ), |
|
483 | - 'DATEDIF' => array( 351, 3, 1, 0 ), |
|
484 | - 'DATESTRING' => array( 352, 1, 1, 0 ), |
|
485 | - 'NUMBERSTRING' => array( 353, 2, 1, 0 ), |
|
486 | - 'ROMAN' => array( 354, -1, 1, 0 ), |
|
487 | - 'GETPIVOTDATA' => array( 358, -1, 0, 0 ), |
|
488 | - 'HYPERLINK' => array( 359, -1, 1, 0 ), |
|
489 | - 'PHONETIC' => array( 360, 1, 0, 0 ), |
|
490 | - 'AVERAGEA' => array( 361, -1, 0, 0 ), |
|
491 | - 'MAXA' => array( 362, -1, 0, 0 ), |
|
492 | - 'MINA' => array( 363, -1, 0, 0 ), |
|
493 | - 'STDEVPA' => array( 364, -1, 0, 0 ), |
|
494 | - 'VARPA' => array( 365, -1, 0, 0 ), |
|
495 | - 'STDEVA' => array( 366, -1, 0, 0 ), |
|
496 | - 'VARA' => array( 367, -1, 0, 0 ), |
|
497 | - 'BAHTTEXT' => array( 368, 1, 0, 0 ), |
|
248 | + 'COUNT' => array(0, -1, 0, 0), |
|
249 | + 'IF' => array(1, -1, 1, 0), |
|
250 | + 'ISNA' => array(2, 1, 1, 0), |
|
251 | + 'ISERROR' => array(3, 1, 1, 0), |
|
252 | + 'SUM' => array(4, -1, 0, 0), |
|
253 | + 'AVERAGE' => array(5, -1, 0, 0), |
|
254 | + 'MIN' => array(6, -1, 0, 0), |
|
255 | + 'MAX' => array(7, -1, 0, 0), |
|
256 | + 'ROW' => array(8, -1, 0, 0), |
|
257 | + 'COLUMN' => array(9, -1, 0, 0), |
|
258 | + 'NA' => array(10, 0, 0, 0), |
|
259 | + 'NPV' => array(11, -1, 1, 0), |
|
260 | + 'STDEV' => array(12, -1, 0, 0), |
|
261 | + 'DOLLAR' => array(13, -1, 1, 0), |
|
262 | + 'FIXED' => array(14, -1, 1, 0), |
|
263 | + 'SIN' => array(15, 1, 1, 0), |
|
264 | + 'COS' => array(16, 1, 1, 0), |
|
265 | + 'TAN' => array(17, 1, 1, 0), |
|
266 | + 'ATAN' => array(18, 1, 1, 0), |
|
267 | + 'PI' => array(19, 0, 1, 0), |
|
268 | + 'SQRT' => array(20, 1, 1, 0), |
|
269 | + 'EXP' => array(21, 1, 1, 0), |
|
270 | + 'LN' => array(22, 1, 1, 0), |
|
271 | + 'LOG10' => array(23, 1, 1, 0), |
|
272 | + 'ABS' => array(24, 1, 1, 0), |
|
273 | + 'INT' => array(25, 1, 1, 0), |
|
274 | + 'SIGN' => array(26, 1, 1, 0), |
|
275 | + 'ROUND' => array(27, 2, 1, 0), |
|
276 | + 'LOOKUP' => array(28, -1, 0, 0), |
|
277 | + 'INDEX' => array(29, -1, 0, 1), |
|
278 | + 'REPT' => array(30, 2, 1, 0), |
|
279 | + 'MID' => array(31, 3, 1, 0), |
|
280 | + 'LEN' => array(32, 1, 1, 0), |
|
281 | + 'VALUE' => array(33, 1, 1, 0), |
|
282 | + 'TRUE' => array(34, 0, 1, 0), |
|
283 | + 'FALSE' => array(35, 0, 1, 0), |
|
284 | + 'AND' => array(36, -1, 0, 0), |
|
285 | + 'OR' => array(37, -1, 0, 0), |
|
286 | + 'NOT' => array(38, 1, 1, 0), |
|
287 | + 'MOD' => array(39, 2, 1, 0), |
|
288 | + 'DCOUNT' => array(40, 3, 0, 0), |
|
289 | + 'DSUM' => array(41, 3, 0, 0), |
|
290 | + 'DAVERAGE' => array(42, 3, 0, 0), |
|
291 | + 'DMIN' => array(43, 3, 0, 0), |
|
292 | + 'DMAX' => array(44, 3, 0, 0), |
|
293 | + 'DSTDEV' => array(45, 3, 0, 0), |
|
294 | + 'VAR' => array(46, -1, 0, 0), |
|
295 | + 'DVAR' => array(47, 3, 0, 0), |
|
296 | + 'TEXT' => array(48, 2, 1, 0), |
|
297 | + 'LINEST' => array(49, -1, 0, 0), |
|
298 | + 'TREND' => array(50, -1, 0, 0), |
|
299 | + 'LOGEST' => array(51, -1, 0, 0), |
|
300 | + 'GROWTH' => array(52, -1, 0, 0), |
|
301 | + 'PV' => array(56, -1, 1, 0), |
|
302 | + 'FV' => array(57, -1, 1, 0), |
|
303 | + 'NPER' => array(58, -1, 1, 0), |
|
304 | + 'PMT' => array(59, -1, 1, 0), |
|
305 | + 'RATE' => array(60, -1, 1, 0), |
|
306 | + 'MIRR' => array(61, 3, 0, 0), |
|
307 | + 'IRR' => array(62, -1, 0, 0), |
|
308 | + 'RAND' => array(63, 0, 1, 1), |
|
309 | + 'MATCH' => array(64, -1, 0, 0), |
|
310 | + 'DATE' => array(65, 3, 1, 0), |
|
311 | + 'TIME' => array(66, 3, 1, 0), |
|
312 | + 'DAY' => array(67, 1, 1, 0), |
|
313 | + 'MONTH' => array(68, 1, 1, 0), |
|
314 | + 'YEAR' => array(69, 1, 1, 0), |
|
315 | + 'WEEKDAY' => array(70, -1, 1, 0), |
|
316 | + 'HOUR' => array(71, 1, 1, 0), |
|
317 | + 'MINUTE' => array(72, 1, 1, 0), |
|
318 | + 'SECOND' => array(73, 1, 1, 0), |
|
319 | + 'NOW' => array(74, 0, 1, 1), |
|
320 | + 'AREAS' => array(75, 1, 0, 1), |
|
321 | + 'ROWS' => array(76, 1, 0, 1), |
|
322 | + 'COLUMNS' => array(77, 1, 0, 1), |
|
323 | + 'OFFSET' => array(78, -1, 0, 1), |
|
324 | + 'SEARCH' => array(82, -1, 1, 0), |
|
325 | + 'TRANSPOSE' => array(83, 1, 1, 0), |
|
326 | + 'TYPE' => array(86, 1, 1, 0), |
|
327 | + 'ATAN2' => array(97, 2, 1, 0), |
|
328 | + 'ASIN' => array(98, 1, 1, 0), |
|
329 | + 'ACOS' => array(99, 1, 1, 0), |
|
330 | + 'CHOOSE' => array(100, -1, 1, 0), |
|
331 | + 'HLOOKUP' => array(101, -1, 0, 0), |
|
332 | + 'VLOOKUP' => array(102, -1, 0, 0), |
|
333 | + 'ISREF' => array(105, 1, 0, 0), |
|
334 | + 'LOG' => array(109, -1, 1, 0), |
|
335 | + 'CHAR' => array(111, 1, 1, 0), |
|
336 | + 'LOWER' => array(112, 1, 1, 0), |
|
337 | + 'UPPER' => array(113, 1, 1, 0), |
|
338 | + 'PROPER' => array(114, 1, 1, 0), |
|
339 | + 'LEFT' => array(115, -1, 1, 0), |
|
340 | + 'RIGHT' => array(116, -1, 1, 0), |
|
341 | + 'EXACT' => array(117, 2, 1, 0), |
|
342 | + 'TRIM' => array(118, 1, 1, 0), |
|
343 | + 'REPLACE' => array(119, 4, 1, 0), |
|
344 | + 'SUBSTITUTE' => array(120, -1, 1, 0), |
|
345 | + 'CODE' => array(121, 1, 1, 0), |
|
346 | + 'FIND' => array(124, -1, 1, 0), |
|
347 | + 'CELL' => array(125, -1, 0, 1), |
|
348 | + 'ISERR' => array(126, 1, 1, 0), |
|
349 | + 'ISTEXT' => array(127, 1, 1, 0), |
|
350 | + 'ISNUMBER' => array(128, 1, 1, 0), |
|
351 | + 'ISBLANK' => array(129, 1, 1, 0), |
|
352 | + 'T' => array(130, 1, 0, 0), |
|
353 | + 'N' => array(131, 1, 0, 0), |
|
354 | + 'DATEVALUE' => array(140, 1, 1, 0), |
|
355 | + 'TIMEVALUE' => array(141, 1, 1, 0), |
|
356 | + 'SLN' => array(142, 3, 1, 0), |
|
357 | + 'SYD' => array(143, 4, 1, 0), |
|
358 | + 'DDB' => array(144, -1, 1, 0), |
|
359 | + 'INDIRECT' => array(148, -1, 1, 1), |
|
360 | + 'CALL' => array(150, -1, 1, 0), |
|
361 | + 'CLEAN' => array(162, 1, 1, 0), |
|
362 | + 'MDETERM' => array(163, 1, 2, 0), |
|
363 | + 'MINVERSE' => array(164, 1, 2, 0), |
|
364 | + 'MMULT' => array(165, 2, 2, 0), |
|
365 | + 'IPMT' => array(167, -1, 1, 0), |
|
366 | + 'PPMT' => array(168, -1, 1, 0), |
|
367 | + 'COUNTA' => array(169, -1, 0, 0), |
|
368 | + 'PRODUCT' => array(183, -1, 0, 0), |
|
369 | + 'FACT' => array(184, 1, 1, 0), |
|
370 | + 'DPRODUCT' => array(189, 3, 0, 0), |
|
371 | + 'ISNONTEXT' => array(190, 1, 1, 0), |
|
372 | + 'STDEVP' => array(193, -1, 0, 0), |
|
373 | + 'VARP' => array(194, -1, 0, 0), |
|
374 | + 'DSTDEVP' => array(195, 3, 0, 0), |
|
375 | + 'DVARP' => array(196, 3, 0, 0), |
|
376 | + 'TRUNC' => array(197, -1, 1, 0), |
|
377 | + 'ISLOGICAL' => array(198, 1, 1, 0), |
|
378 | + 'DCOUNTA' => array(199, 3, 0, 0), |
|
379 | + 'USDOLLAR' => array(204, -1, 1, 0), |
|
380 | + 'FINDB' => array(205, -1, 1, 0), |
|
381 | + 'SEARCHB' => array(206, -1, 1, 0), |
|
382 | + 'REPLACEB' => array(207, 4, 1, 0), |
|
383 | + 'LEFTB' => array(208, -1, 1, 0), |
|
384 | + 'RIGHTB' => array(209, -1, 1, 0), |
|
385 | + 'MIDB' => array(210, 3, 1, 0), |
|
386 | + 'LENB' => array(211, 1, 1, 0), |
|
387 | + 'ROUNDUP' => array(212, 2, 1, 0), |
|
388 | + 'ROUNDDOWN' => array(213, 2, 1, 0), |
|
389 | + 'ASC' => array(214, 1, 1, 0), |
|
390 | + 'DBCS' => array(215, 1, 1, 0), |
|
391 | + 'RANK' => array(216, -1, 0, 0), |
|
392 | + 'ADDRESS' => array(219, -1, 1, 0), |
|
393 | + 'DAYS360' => array(220, -1, 1, 0), |
|
394 | + 'TODAY' => array(221, 0, 1, 1), |
|
395 | + 'VDB' => array(222, -1, 1, 0), |
|
396 | + 'MEDIAN' => array(227, -1, 0, 0), |
|
397 | + 'SUMPRODUCT' => array(228, -1, 2, 0), |
|
398 | + 'SINH' => array(229, 1, 1, 0), |
|
399 | + 'COSH' => array(230, 1, 1, 0), |
|
400 | + 'TANH' => array(231, 1, 1, 0), |
|
401 | + 'ASINH' => array(232, 1, 1, 0), |
|
402 | + 'ACOSH' => array(233, 1, 1, 0), |
|
403 | + 'ATANH' => array(234, 1, 1, 0), |
|
404 | + 'DGET' => array(235, 3, 0, 0), |
|
405 | + 'INFO' => array(244, 1, 1, 1), |
|
406 | + 'DB' => array(247, -1, 1, 0), |
|
407 | + 'FREQUENCY' => array(252, 2, 0, 0), |
|
408 | + 'ERROR.TYPE' => array(261, 1, 1, 0), |
|
409 | + 'REGISTER.ID' => array(267, -1, 1, 0), |
|
410 | + 'AVEDEV' => array(269, -1, 0, 0), |
|
411 | + 'BETADIST' => array(270, -1, 1, 0), |
|
412 | + 'GAMMALN' => array(271, 1, 1, 0), |
|
413 | + 'BETAINV' => array(272, -1, 1, 0), |
|
414 | + 'BINOMDIST' => array(273, 4, 1, 0), |
|
415 | + 'CHIDIST' => array(274, 2, 1, 0), |
|
416 | + 'CHIINV' => array(275, 2, 1, 0), |
|
417 | + 'COMBIN' => array(276, 2, 1, 0), |
|
418 | + 'CONFIDENCE' => array(277, 3, 1, 0), |
|
419 | + 'CRITBINOM' => array(278, 3, 1, 0), |
|
420 | + 'EVEN' => array(279, 1, 1, 0), |
|
421 | + 'EXPONDIST' => array(280, 3, 1, 0), |
|
422 | + 'FDIST' => array(281, 3, 1, 0), |
|
423 | + 'FINV' => array(282, 3, 1, 0), |
|
424 | + 'FISHER' => array(283, 1, 1, 0), |
|
425 | + 'FISHERINV' => array(284, 1, 1, 0), |
|
426 | + 'FLOOR' => array(285, 2, 1, 0), |
|
427 | + 'GAMMADIST' => array(286, 4, 1, 0), |
|
428 | + 'GAMMAINV' => array(287, 3, 1, 0), |
|
429 | + 'CEILING' => array(288, 2, 1, 0), |
|
430 | + 'HYPGEOMDIST' => array(289, 4, 1, 0), |
|
431 | + 'LOGNORMDIST' => array(290, 3, 1, 0), |
|
432 | + 'LOGINV' => array(291, 3, 1, 0), |
|
433 | + 'NEGBINOMDIST' => array(292, 3, 1, 0), |
|
434 | + 'NORMDIST' => array(293, 4, 1, 0), |
|
435 | + 'NORMSDIST' => array(294, 1, 1, 0), |
|
436 | + 'NORMINV' => array(295, 3, 1, 0), |
|
437 | + 'NORMSINV' => array(296, 1, 1, 0), |
|
438 | + 'STANDARDIZE' => array(297, 3, 1, 0), |
|
439 | + 'ODD' => array(298, 1, 1, 0), |
|
440 | + 'PERMUT' => array(299, 2, 1, 0), |
|
441 | + 'POISSON' => array(300, 3, 1, 0), |
|
442 | + 'TDIST' => array(301, 3, 1, 0), |
|
443 | + 'WEIBULL' => array(302, 4, 1, 0), |
|
444 | + 'SUMXMY2' => array(303, 2, 2, 0), |
|
445 | + 'SUMX2MY2' => array(304, 2, 2, 0), |
|
446 | + 'SUMX2PY2' => array(305, 2, 2, 0), |
|
447 | + 'CHITEST' => array(306, 2, 2, 0), |
|
448 | + 'CORREL' => array(307, 2, 2, 0), |
|
449 | + 'COVAR' => array(308, 2, 2, 0), |
|
450 | + 'FORECAST' => array(309, 3, 2, 0), |
|
451 | + 'FTEST' => array(310, 2, 2, 0), |
|
452 | + 'INTERCEPT' => array(311, 2, 2, 0), |
|
453 | + 'PEARSON' => array(312, 2, 2, 0), |
|
454 | + 'RSQ' => array(313, 2, 2, 0), |
|
455 | + 'STEYX' => array(314, 2, 2, 0), |
|
456 | + 'SLOPE' => array(315, 2, 2, 0), |
|
457 | + 'TTEST' => array(316, 4, 2, 0), |
|
458 | + 'PROB' => array(317, -1, 2, 0), |
|
459 | + 'DEVSQ' => array(318, -1, 0, 0), |
|
460 | + 'GEOMEAN' => array(319, -1, 0, 0), |
|
461 | + 'HARMEAN' => array(320, -1, 0, 0), |
|
462 | + 'SUMSQ' => array(321, -1, 0, 0), |
|
463 | + 'KURT' => array(322, -1, 0, 0), |
|
464 | + 'SKEW' => array(323, -1, 0, 0), |
|
465 | + 'ZTEST' => array(324, -1, 0, 0), |
|
466 | + 'LARGE' => array(325, 2, 0, 0), |
|
467 | + 'SMALL' => array(326, 2, 0, 0), |
|
468 | + 'QUARTILE' => array(327, 2, 0, 0), |
|
469 | + 'PERCENTILE' => array(328, 2, 0, 0), |
|
470 | + 'PERCENTRANK' => array(329, -1, 0, 0), |
|
471 | + 'MODE' => array(330, -1, 2, 0), |
|
472 | + 'TRIMMEAN' => array(331, 2, 0, 0), |
|
473 | + 'TINV' => array(332, 2, 1, 0), |
|
474 | + 'CONCATENATE' => array(336, -1, 1, 0), |
|
475 | + 'POWER' => array(337, 2, 1, 0), |
|
476 | + 'RADIANS' => array(342, 1, 1, 0), |
|
477 | + 'DEGREES' => array(343, 1, 1, 0), |
|
478 | + 'SUBTOTAL' => array(344, -1, 0, 0), |
|
479 | + 'SUMIF' => array(345, -1, 0, 0), |
|
480 | + 'COUNTIF' => array(346, 2, 0, 0), |
|
481 | + 'COUNTBLANK' => array(347, 1, 0, 0), |
|
482 | + 'ISPMT' => array(350, 4, 1, 0), |
|
483 | + 'DATEDIF' => array(351, 3, 1, 0), |
|
484 | + 'DATESTRING' => array(352, 1, 1, 0), |
|
485 | + 'NUMBERSTRING' => array(353, 2, 1, 0), |
|
486 | + 'ROMAN' => array(354, -1, 1, 0), |
|
487 | + 'GETPIVOTDATA' => array(358, -1, 0, 0), |
|
488 | + 'HYPERLINK' => array(359, -1, 1, 0), |
|
489 | + 'PHONETIC' => array(360, 1, 0, 0), |
|
490 | + 'AVERAGEA' => array(361, -1, 0, 0), |
|
491 | + 'MAXA' => array(362, -1, 0, 0), |
|
492 | + 'MINA' => array(363, -1, 0, 0), |
|
493 | + 'STDEVPA' => array(364, -1, 0, 0), |
|
494 | + 'VARPA' => array(365, -1, 0, 0), |
|
495 | + 'STDEVA' => array(366, -1, 0, 0), |
|
496 | + 'VARA' => array(367, -1, 0, 0), |
|
497 | + 'BAHTTEXT' => array(368, 1, 0, 0), |
|
498 | 498 | ); |
499 | 499 | } |
500 | 500 | |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | */ |
598 | 598 | private function convertFunction($token, $num_args) |
599 | 599 | { |
600 | - $args = $this->functions[$token][1]; |
|
600 | + $args = $this->functions[$token][1]; |
|
601 | 601 | // $volatile = $this->functions[$token][3]; |
602 | 602 | |
603 | 603 | // Fixed number of args eg. TIME($i, $j, $k). |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | // TODO: use real error codes |
645 | 645 | throw new \PhpSpreadsheet\Writer\Exception("Unknown class $class"); |
646 | 646 | } |
647 | - return $ptgArea . $row1 . $row2 . $col1. $col2; |
|
647 | + return $ptgArea . $row1 . $row2 . $col1 . $col2; |
|
648 | 648 | } |
649 | 649 | |
650 | 650 | /** |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | list($row1, $col1) = $this->cellToPackedRowcol($cell1); |
674 | 674 | list($row2, $col2) = $this->cellToPackedRowcol($cell2); |
675 | 675 | } else { // It's a rows range (like 26:27) |
676 | - list($row1, $col1, $row2, $col2) = $this->rangeToPackedRange($cell1.':'.$cell2); |
|
676 | + list($row1, $col1, $row2, $col2) = $this->rangeToPackedRange($cell1 . ':' . $cell2); |
|
677 | 677 | } |
678 | 678 | |
679 | 679 | // The ptg value depends on the class of the ptg. |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | // throw new \PhpSpreadsheet\Writer\Exception("Unknown class $class"); |
688 | 688 | // } |
689 | 689 | |
690 | - return $ptgArea . $ext_ref . $row1 . $row2 . $col1. $col2; |
|
690 | + return $ptgArea . $ext_ref . $row1 . $row2 . $col1 . $col2; |
|
691 | 691 | } |
692 | 692 | |
693 | 693 | /** |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | // // TODO: use real error codes |
717 | 717 | // throw new \PhpSpreadsheet\Writer\Exception("Unknown class $class"); |
718 | 718 | // } |
719 | - return $ptgRef.$row.$col; |
|
719 | + return $ptgRef . $row . $col; |
|
720 | 720 | } |
721 | 721 | |
722 | 722 | /** |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | // throw new \PhpSpreadsheet\Writer\Exception("Unknown class $class"); |
752 | 752 | // } |
753 | 753 | |
754 | - return $ptgRef . $ext_ref. $row . $col; |
|
754 | + return $ptgRef . $ext_ref . $row . $col; |
|
755 | 755 | } |
756 | 756 | |
757 | 757 | /** |
@@ -1037,7 +1037,7 @@ discard block |
||
1037 | 1037 | } |
1038 | 1038 | |
1039 | 1039 | if ($i < ($formula_length - 1)) { |
1040 | - $this->lookAhead = $this->formula{$i+1}; |
|
1040 | + $this->lookAhead = $this->formula{$i + 1}; |
|
1041 | 1041 | } |
1042 | 1042 | $token = ''; |
1043 | 1043 | } |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | $token .= $this->formula{$i}; |
1047 | 1047 | |
1048 | 1048 | if ($i < ($formula_length - 1)) { |
1049 | - $this->lookAhead = $this->formula{$i+1}; |
|
1049 | + $this->lookAhead = $this->formula{$i + 1}; |
|
1050 | 1050 | } else { |
1051 | 1051 | $this->lookAhead = ''; |
1052 | 1052 | } |
@@ -1061,7 +1061,7 @@ discard block |
||
1061 | 1061 | } |
1062 | 1062 | |
1063 | 1063 | if ($i < ($formula_length - 2)) { |
1064 | - $this->lookAhead = $this->formula{$i+2}; |
|
1064 | + $this->lookAhead = $this->formula{$i + 2}; |
|
1065 | 1065 | } else { // if we run out of characters lookAhead becomes empty |
1066 | 1066 | $this->lookAhead = ''; |
1067 | 1067 | } |
@@ -1129,10 +1129,10 @@ discard block |
||
1129 | 1129 | } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $token) and !preg_match("/[0-9]/", $this->lookAhead)) { |
1130 | 1130 | // If it's an external range like 'Sheet1'!A1:B2 or 'Sheet1:Sheet2'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1:Sheet2'!$A$1:$B$2 |
1131 | 1131 | return $token; |
1132 | - } elseif (is_numeric($token) and (!is_numeric($token.$this->lookAhead) or ($this->lookAhead == '')) and ($this->lookAhead != '!') and ($this->lookAhead != ':')) { |
|
1132 | + } elseif (is_numeric($token) and (!is_numeric($token . $this->lookAhead) or ($this->lookAhead == '')) and ($this->lookAhead != '!') and ($this->lookAhead != ':')) { |
|
1133 | 1133 | // If it's a number (check that it's not a sheet name or range) |
1134 | 1134 | return $token; |
1135 | - } elseif (preg_match("/\"([^\"]|\"\"){0,255}\"/", $token) and $this->lookAhead != '"' and (substr_count($token, '"')%2 == 0)) { |
|
1135 | + } elseif (preg_match("/\"([^\"]|\"\"){0,255}\"/", $token) and $this->lookAhead != '"' and (substr_count($token, '"') % 2 == 0)) { |
|
1136 | 1136 | // If it's a string (of maximum 255 characters) |
1137 | 1137 | return $token; |
1138 | 1138 | } elseif (preg_match("/^#[A-Z0\/]{3,5}[!?]{1}$/", $token) or $token == '#N/A') { |
@@ -1164,7 +1164,7 @@ discard block |
||
1164 | 1164 | $this->formula = $formula; |
1165 | 1165 | $this->lookAhead = isset($formula{1}) ? $formula{1} : ''; |
1166 | 1166 | $this->advance(); |
1167 | - $this->parseTree = $this->condition(); |
|
1167 | + $this->parseTree = $this->condition(); |
|
1168 | 1168 | return true; |
1169 | 1169 | } |
1170 | 1170 | |
@@ -1329,12 +1329,12 @@ discard block |
||
1329 | 1329 | private function fact() |
1330 | 1330 | { |
1331 | 1331 | if ($this->currentToken == "(") { |
1332 | - $this->advance(); // eat the "(" |
|
1332 | + $this->advance(); // eat the "(" |
|
1333 | 1333 | $result = $this->parenthesizedExpression(); |
1334 | 1334 | if ($this->currentToken != ")") { |
1335 | 1335 | throw new \PhpSpreadsheet\Writer\Exception("')' token expected."); |
1336 | 1336 | } |
1337 | - $this->advance(); // eat the ")" |
|
1337 | + $this->advance(); // eat the ")" |
|
1338 | 1338 | return $result; |
1339 | 1339 | } |
1340 | 1340 | // if it's a reference |
@@ -1377,7 +1377,7 @@ discard block |
||
1377 | 1377 | // If it's a number or a percent |
1378 | 1378 | if ($this->lookAhead == '%') { |
1379 | 1379 | $result = $this->createTree('ptgPercent', $this->currentToken, ''); |
1380 | - $this->advance(); // Skip the percentage operator once we've pre-built that tree |
|
1380 | + $this->advance(); // Skip the percentage operator once we've pre-built that tree |
|
1381 | 1381 | } else { |
1382 | 1382 | $result = $this->createTree($this->currentToken, '', ''); |
1383 | 1383 | } |
@@ -1388,7 +1388,7 @@ discard block |
||
1388 | 1388 | $result = $this->func(); |
1389 | 1389 | return $result; |
1390 | 1390 | } |
1391 | - throw new \PhpSpreadsheet\Writer\Exception("Syntax error: ".$this->currentToken.", lookahead: ".$this->lookAhead.", current char: ".$this->currentCharacter); |
|
1391 | + throw new \PhpSpreadsheet\Writer\Exception("Syntax error: " . $this->currentToken . ", lookahead: " . $this->lookAhead . ", current char: " . $this->currentCharacter); |
|
1392 | 1392 | } |
1393 | 1393 | |
1394 | 1394 | /** |
@@ -1404,12 +1404,12 @@ discard block |
||
1404 | 1404 | $function = strtoupper($this->currentToken); |
1405 | 1405 | $result = ''; // initialize result |
1406 | 1406 | $this->advance(); |
1407 | - $this->advance(); // eat the "(" |
|
1407 | + $this->advance(); // eat the "(" |
|
1408 | 1408 | while ($this->currentToken != ')') { |
1409 | 1409 | /**/ |
1410 | 1410 | if ($num_args > 0) { |
1411 | 1411 | if ($this->currentToken == "," || $this->currentToken == ";") { |
1412 | - $this->advance(); // eat the "," or ";" |
|
1412 | + $this->advance(); // eat the "," or ";" |
|
1413 | 1413 | } else { |
1414 | 1414 | throw new \PhpSpreadsheet\Writer\Exception("Syntax error: comma expected in function $function, arg #{$num_args}"); |
1415 | 1415 | } |
@@ -1431,7 +1431,7 @@ discard block |
||
1431 | 1431 | } |
1432 | 1432 | |
1433 | 1433 | $result = $this->createTree($function, $result, $num_args); |
1434 | - $this->advance(); // eat the ")" |
|
1434 | + $this->advance(); // eat the ")" |
|
1435 | 1435 | return $result; |
1436 | 1436 | } |
1437 | 1437 | |
@@ -1511,7 +1511,7 @@ discard block |
||
1511 | 1511 | $left_tree = ''; |
1512 | 1512 | } |
1513 | 1513 | // add it's left subtree and return. |
1514 | - return $left_tree.$this->convertFunction($tree['value'], $tree['right']); |
|
1514 | + return $left_tree . $this->convertFunction($tree['value'], $tree['right']); |
|
1515 | 1515 | } else { |
1516 | 1516 | $converted_tree = $this->convert($tree['value']); |
1517 | 1517 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $objWriter->startElement('sheetPr'); |
148 | 148 | //$objWriter->writeAttribute('codeName', $pSheet->getTitle()); |
149 | 149 | if ($pSheet->getParent()->hasMacros()) {//if the workbook have macros, we need to have codeName for the sheet |
150 | - if ($pSheet->hasCodeName()==false) { |
|
150 | + if ($pSheet->hasCodeName() == false) { |
|
151 | 151 | $pSheet->setCodeName($pSheet->getTitle()); |
152 | 152 | } |
153 | 153 | $objWriter->writeAttribute('codeName', $pSheet->getCodeName()); |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | } |
330 | 330 | |
331 | 331 | // Set Zero Height row |
332 | - if ((string)$pSheet->getDefaultRowDimension()->getZeroHeight() == '1' || |
|
333 | - strtolower((string)$pSheet->getDefaultRowDimension()->getZeroHeight()) == 'true') { |
|
332 | + if ((string) $pSheet->getDefaultRowDimension()->getZeroHeight() == '1' || |
|
333 | + strtolower((string) $pSheet->getDefaultRowDimension()->getZeroHeight()) == 'true') { |
|
334 | 334 | $objWriter->writeAttribute('zeroHeight', '1'); |
335 | 335 | } |
336 | 336 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | $outlineLevelRow = $dimension->getOutlineLevel(); |
347 | 347 | } |
348 | 348 | } |
349 | - $objWriter->writeAttribute('outlineLevelRow', (int)$outlineLevelRow); |
|
349 | + $objWriter->writeAttribute('outlineLevelRow', (int) $outlineLevelRow); |
|
350 | 350 | |
351 | 351 | // Outline level - column |
352 | 352 | $outlineLevelCol = 0; |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | $outlineLevelCol = $dimension->getOutlineLevel(); |
356 | 356 | } |
357 | 357 | } |
358 | - $objWriter->writeAttribute('outlineLevelCol', (int)$outlineLevelCol); |
|
358 | + $objWriter->writeAttribute('outlineLevelCol', (int) $outlineLevelCol); |
|
359 | 359 | |
360 | 360 | $objWriter->endElement(); |
361 | 361 | } |
@@ -565,10 +565,10 @@ discard block |
||
565 | 565 | $objWriter->writeAttribute('operator', $dv->getOperator()); |
566 | 566 | } |
567 | 567 | |
568 | - $objWriter->writeAttribute('allowBlank', ($dv->getAllowBlank() ? '1' : '0')); |
|
569 | - $objWriter->writeAttribute('showDropDown', (!$dv->getShowDropDown() ? '1' : '0')); |
|
570 | - $objWriter->writeAttribute('showInputMessage', ($dv->getShowInputMessage() ? '1' : '0')); |
|
571 | - $objWriter->writeAttribute('showErrorMessage', ($dv->getShowErrorMessage() ? '1' : '0')); |
|
568 | + $objWriter->writeAttribute('allowBlank', ($dv->getAllowBlank() ? '1' : '0')); |
|
569 | + $objWriter->writeAttribute('showDropDown', (!$dv->getShowDropDown() ? '1' : '0')); |
|
570 | + $objWriter->writeAttribute('showInputMessage', ($dv->getShowInputMessage() ? '1' : '0')); |
|
571 | + $objWriter->writeAttribute('showErrorMessage', ($dv->getShowErrorMessage() ? '1' : '0')); |
|
572 | 572 | |
573 | 573 | if ($dv->getErrorTitle() !== '') { |
574 | 574 | $objWriter->writeAttribute('errorTitle', $dv->getErrorTitle()); |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | // printOptions |
707 | 707 | $objWriter->startElement('printOptions'); |
708 | 708 | |
709 | - $objWriter->writeAttribute('gridLines', ($pSheet->getPrintGridlines() ? 'true': 'false')); |
|
709 | + $objWriter->writeAttribute('gridLines', ($pSheet->getPrintGridlines() ? 'true' : 'false')); |
|
710 | 710 | $objWriter->writeAttribute('gridLinesSet', 'true'); |
711 | 711 | |
712 | 712 | if ($pSheet->getPageSetup()->getHorizontalCentered()) { |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | // Top 10 Filter Rule |
800 | 800 | $objWriter->writeAttribute('val', $rule->getValue()); |
801 | 801 | $objWriter->writeAttribute('percent', (($rule->getOperator() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) ? '1' : '0')); |
802 | - $objWriter->writeAttribute('top', (($rule->getGrouping() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) ? '1': '0')); |
|
802 | + $objWriter->writeAttribute('top', (($rule->getGrouping() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) ? '1' : '0')); |
|
803 | 803 | } else { |
804 | 804 | // Filter, DateGroupItem or CustomFilter |
805 | 805 | $objWriter->startElement($rule->getRuleType()); |
@@ -1078,8 +1078,7 @@ discard block |
||
1078 | 1078 | break; |
1079 | 1079 | case 'f': // Formula |
1080 | 1080 | $calculatedValue = ($this->getParentWriter()->getPreCalculateFormulas()) ? |
1081 | - $pCell->getCalculatedValue() : |
|
1082 | - $cellValue; |
|
1081 | + $pCell->getCalculatedValue() : $cellValue; |
|
1083 | 1082 | if (is_string($calculatedValue)) { |
1084 | 1083 | $objWriter->writeAttribute('t', 'str'); |
1085 | 1084 | } |
@@ -1091,7 +1090,7 @@ discard block |
||
1091 | 1090 | // Write data depending on its type |
1092 | 1091 | switch (strtolower($mappedType)) { |
1093 | 1092 | case 'inlinestr': // Inline string |
1094 | - if (! $cellValue instanceof \PhpSpreadsheet\RichText) { |
|
1093 | + if (!$cellValue instanceof \PhpSpreadsheet\RichText) { |
|
1095 | 1094 | $objWriter->writeElement('t', \PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML(htmlspecialchars($cellValue))); |
1096 | 1095 | } elseif ($cellValue instanceof \PhpSpreadsheet\RichText) { |
1097 | 1096 | $objWriter->startElement('is'); |
@@ -1101,7 +1100,7 @@ discard block |
||
1101 | 1100 | |
1102 | 1101 | break; |
1103 | 1102 | case 's': // String |
1104 | - if (! $cellValue instanceof \PhpSpreadsheet\RichText) { |
|
1103 | + if (!$cellValue instanceof \PhpSpreadsheet\RichText) { |
|
1105 | 1104 | if (isset($pFlippedStringTable[$cellValue])) { |
1106 | 1105 | $objWriter->writeElement('v', $pFlippedStringTable[$cellValue]); |
1107 | 1106 | } |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | $aMediaContentTypes = array(); |
130 | 130 | $mediaCount = $this->getParentWriter()->getDrawingHashTable()->count(); |
131 | 131 | for ($i = 0; $i < $mediaCount; ++$i) { |
132 | - $extension = ''; |
|
133 | - $mimeType = ''; |
|
132 | + $extension = ''; |
|
133 | + $mimeType = ''; |
|
134 | 134 | |
135 | 135 | if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof \PhpSpreadsheet\Worksheet\Drawing) { |
136 | 136 | $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension()); |
@@ -152,9 +152,9 @@ discard block |
||
152 | 152 | if ($spreadsheet->hasRibbonBinObjects()) { |
153 | 153 | // Some additional objects in the ribbon ? |
154 | 154 | // we need to write "Extension" but not already write for media content |
155 | - $tabRibbonTypes=array_diff($spreadsheet->getRibbonBinObjects('types'), array_keys($aMediaContentTypes)); |
|
155 | + $tabRibbonTypes = array_diff($spreadsheet->getRibbonBinObjects('types'), array_keys($aMediaContentTypes)); |
|
156 | 156 | foreach ($tabRibbonTypes as $aRibbonType) { |
157 | - $mimeType='image/.'.$aRibbonType;//we wrote $mimeType like customUI Editor |
|
157 | + $mimeType = 'image/.' . $aRibbonType; //we wrote $mimeType like customUI Editor |
|
158 | 158 | $this->writeDefaultContentType($objWriter, $aRibbonType, $mimeType); |
159 | 159 | } |
160 | 160 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | // Create string lookup table |
41 | 41 | $aStringTable = array(); |
42 | 42 | $cellCollection = null; |
43 | - $aFlippedStringTable = null; // For faster lookup |
|
43 | + $aFlippedStringTable = null; // For faster lookup |
|
44 | 44 | |
45 | 45 | // Is an existing table given? |
46 | 46 | if (($pExistingTable !== null) && is_array($pExistingTable)) { |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | foreach ($pStringTable as $textElement) { |
106 | 106 | $objWriter->startElement('si'); |
107 | 107 | |
108 | - if (! $textElement instanceof \PhpSpreadsheet\RichText) { |
|
108 | + if (!$textElement instanceof \PhpSpreadsheet\RichText) { |
|
109 | 109 | $textToWrite = \PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($textElement); |
110 | 110 | $objWriter->startElement('t'); |
111 | 111 | if ($textToWrite !== trim($textToWrite)) { |
@@ -146,31 +146,31 @@ discard block |
||
146 | 146 | $elements = $pRichText->getRichTextElements(); |
147 | 147 | foreach ($elements as $element) { |
148 | 148 | // r |
149 | - $objWriter->startElement($prefix.'r'); |
|
149 | + $objWriter->startElement($prefix . 'r'); |
|
150 | 150 | |
151 | 151 | // rPr |
152 | 152 | if ($element instanceof \PhpSpreadsheet\RichText\Run) { |
153 | 153 | // rPr |
154 | - $objWriter->startElement($prefix.'rPr'); |
|
154 | + $objWriter->startElement($prefix . 'rPr'); |
|
155 | 155 | |
156 | 156 | // rFont |
157 | - $objWriter->startElement($prefix.'rFont'); |
|
157 | + $objWriter->startElement($prefix . 'rFont'); |
|
158 | 158 | $objWriter->writeAttribute('val', $element->getFont()->getName()); |
159 | 159 | $objWriter->endElement(); |
160 | 160 | |
161 | 161 | // Bold |
162 | - $objWriter->startElement($prefix.'b'); |
|
162 | + $objWriter->startElement($prefix . 'b'); |
|
163 | 163 | $objWriter->writeAttribute('val', ($element->getFont()->getBold() ? 'true' : 'false')); |
164 | 164 | $objWriter->endElement(); |
165 | 165 | |
166 | 166 | // Italic |
167 | - $objWriter->startElement($prefix.'i'); |
|
167 | + $objWriter->startElement($prefix . 'i'); |
|
168 | 168 | $objWriter->writeAttribute('val', ($element->getFont()->getItalic() ? 'true' : 'false')); |
169 | 169 | $objWriter->endElement(); |
170 | 170 | |
171 | 171 | // Superscript / subscript |
172 | 172 | if ($element->getFont()->getSuperScript() || $element->getFont()->getSubScript()) { |
173 | - $objWriter->startElement($prefix.'vertAlign'); |
|
173 | + $objWriter->startElement($prefix . 'vertAlign'); |
|
174 | 174 | if ($element->getFont()->getSuperScript()) { |
175 | 175 | $objWriter->writeAttribute('val', 'superscript'); |
176 | 176 | } elseif ($element->getFont()->getSubScript()) { |
@@ -180,22 +180,22 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | // Strikethrough |
183 | - $objWriter->startElement($prefix.'strike'); |
|
183 | + $objWriter->startElement($prefix . 'strike'); |
|
184 | 184 | $objWriter->writeAttribute('val', ($element->getFont()->getStrikethrough() ? 'true' : 'false')); |
185 | 185 | $objWriter->endElement(); |
186 | 186 | |
187 | 187 | // Color |
188 | - $objWriter->startElement($prefix.'color'); |
|
188 | + $objWriter->startElement($prefix . 'color'); |
|
189 | 189 | $objWriter->writeAttribute('rgb', $element->getFont()->getColor()->getARGB()); |
190 | 190 | $objWriter->endElement(); |
191 | 191 | |
192 | 192 | // Size |
193 | - $objWriter->startElement($prefix.'sz'); |
|
193 | + $objWriter->startElement($prefix . 'sz'); |
|
194 | 194 | $objWriter->writeAttribute('val', $element->getFont()->getSize()); |
195 | 195 | $objWriter->endElement(); |
196 | 196 | |
197 | 197 | // Underline |
198 | - $objWriter->startElement($prefix.'u'); |
|
198 | + $objWriter->startElement($prefix . 'u'); |
|
199 | 199 | $objWriter->writeAttribute('val', $element->getFont()->getUnderline()); |
200 | 200 | $objWriter->endElement(); |
201 | 201 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | // t |
206 | - $objWriter->startElement($prefix.'t'); |
|
206 | + $objWriter->startElement($prefix . 't'); |
|
207 | 207 | $objWriter->writeAttribute('xml:space', 'preserve'); |
208 | 208 | $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); |
209 | 209 | $objWriter->endElement(); |
@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | $elements = $pRichText->getRichTextElements(); |
237 | 237 | foreach ($elements as $element) { |
238 | 238 | // r |
239 | - $objWriter->startElement($prefix.'r'); |
|
239 | + $objWriter->startElement($prefix . 'r'); |
|
240 | 240 | |
241 | 241 | // rPr |
242 | - $objWriter->startElement($prefix.'rPr'); |
|
242 | + $objWriter->startElement($prefix . 'rPr'); |
|
243 | 243 | |
244 | 244 | // Bold |
245 | 245 | $objWriter->writeAttribute('b', ($element->getFont()->getBold() ? 1 : 0)); |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $objWriter->writeAttribute('strike', ($element->getFont()->getStrikethrough() ? 'sngStrike' : 'noStrike')); |
261 | 261 | |
262 | 262 | // rFont |
263 | - $objWriter->startElement($prefix.'latin'); |
|
263 | + $objWriter->startElement($prefix . 'latin'); |
|
264 | 264 | $objWriter->writeAttribute('typeface', $element->getFont()->getName()); |
265 | 265 | $objWriter->endElement(); |
266 | 266 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $objWriter->endElement(); |
279 | 279 | |
280 | 280 | // t |
281 | - $objWriter->startElement($prefix.'t'); |
|
281 | + $objWriter->startElement($prefix . 't'); |
|
282 | 282 | // $objWriter->writeAttribute('xml:space', 'preserve'); // Excel2010 accepts, Excel2007 complains |
283 | 283 | $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); |
284 | 284 | $objWriter->endElement(); |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | |
301 | 301 | // Loop through stringtable and add flipped items to $returnValue |
302 | 302 | foreach ($stringTable as $key => $value) { |
303 | - if (! $value instanceof \PhpSpreadsheet\RichText) { |
|
303 | + if (!$value instanceof \PhpSpreadsheet\RichText) { |
|
304 | 304 | $returnValue[$value] = $key; |
305 | 305 | } elseif ($value instanceof \PhpSpreadsheet\RichText) { |
306 | 306 | $returnValue[$value->getHashCode()] = $key; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | // Loop through charts and write the chart position |
70 | 70 | if ($chartCount > 0) { |
71 | 71 | for ($c = 0; $c < $chartCount; ++$c) { |
72 | - $this->writeChart($objWriter, $pWorksheet->getChartByIndex($c), $c+$i); |
|
72 | + $this->writeChart($objWriter, $pWorksheet->getChartByIndex($c), $c + $i); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $objWriter->writeAttribute('macro', ''); |
115 | 115 | $objWriter->startElement('xdr:nvGraphicFramePr'); |
116 | 116 | $objWriter->startElement('xdr:cNvPr'); |
117 | - $objWriter->writeAttribute('name', 'Chart '.$pRelationId); |
|
117 | + $objWriter->writeAttribute('name', 'Chart ' . $pRelationId); |
|
118 | 118 | $objWriter->writeAttribute('id', 1025 * $pRelationId); |
119 | 119 | $objWriter->endElement(); |
120 | 120 | $objWriter->startElement('xdr:cNvGraphicFramePr'); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $objWriter->startElement('c:chart'); |
141 | 141 | $objWriter->writeAttribute('xmlns:c', 'http://schemas.openxmlformats.org/drawingml/2006/chart'); |
142 | 142 | $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); |
143 | - $objWriter->writeAttribute('r:id', 'rId'.$pRelationId); |
|
143 | + $objWriter->writeAttribute('r:id', 'rId' . $pRelationId); |
|
144 | 144 | $objWriter->endElement(); |
145 | 145 | $objWriter->endElement(); |
146 | 146 | $objWriter->endElement(); |
@@ -166,8 +166,8 @@ discard block |
||
166 | 166 | // xdr:oneCellAnchor |
167 | 167 | $objWriter->startElement('xdr:oneCellAnchor'); |
168 | 168 | // Image location |
169 | - $aCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($pDrawing->getCoordinates()); |
|
170 | - $aCoordinates[0] = \PhpSpreadsheet\Cell::columnIndexFromString($aCoordinates[0]); |
|
169 | + $aCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($pDrawing->getCoordinates()); |
|
170 | + $aCoordinates[0] = \PhpSpreadsheet\Cell::columnIndexFromString($aCoordinates[0]); |
|
171 | 171 | |
172 | 172 | // xdr:from |
173 | 173 | $objWriter->startElement('xdr:from'); |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | public function allDrawings(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) |
571 | 571 | { |
572 | 572 | // Get an array of all drawings |
573 | - $aDrawings = array(); |
|
573 | + $aDrawings = array(); |
|
574 | 574 | |
575 | 575 | // Loop through PhpSpreadsheet |
576 | 576 | $sheetCount = $spreadsheet->getSheetCount(); |