@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | * @static |
35 | 35 | */ |
36 | 36 | private static $searchLocations = array( |
37 | - array( 'type' => 'IWriter', 'path' => 'PhpSpreadsheet/Writer/{0}.php', 'class' => '\\PhpSpreadsheet\\Writer\\{0}' ), |
|
38 | - array( 'type' => 'IReader', 'path' => 'PhpSpreadsheet/Reader/{0}.php', 'class' => '\\PhpSpreadsheet\\Reader\\{0}' ) |
|
37 | + array('type' => 'IWriter', 'path' => 'PhpSpreadsheet/Writer/{0}.php', 'class' => '\\PhpSpreadsheet\\Writer\\{0}'), |
|
38 | + array('type' => 'IReader', 'path' => 'PhpSpreadsheet/Reader/{0}.php', 'class' => '\\PhpSpreadsheet\\Reader\\{0}') |
|
39 | 39 | ); |
40 | 40 | |
41 | 41 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public static function addSearchLocation($type = '', $location = '', $classname = '') |
105 | 105 | { |
106 | - self::$searchLocations[] = array( 'type' => $type, 'path' => $location, 'class' => $classname ); |
|
106 | + self::$searchLocations[] = array('type' => $type, 'path' => $location, 'class' => $classname); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -456,8 +456,8 @@ discard block |
||
456 | 456 | // total byte size of Excel data (workbook global substream + sheet substreams) |
457 | 457 | $this->dataSize = strlen($this->data); |
458 | 458 | |
459 | - $this->pos = 0; |
|
460 | - $this->sheets = array(); |
|
459 | + $this->pos = 0; |
|
460 | + $this->sheets = array(); |
|
461 | 461 | |
462 | 462 | // Parse Workbook Global Substream |
463 | 463 | while ($this->pos < $this->dataSize) { |
@@ -1123,7 +1123,7 @@ discard block |
||
1123 | 1123 | // $range should look like one of these |
1124 | 1124 | // Foo!$C$7:$J$66 |
1125 | 1125 | // Bar!$A$1:$IV$2 |
1126 | - $explodes = explode('!', $range); // FIXME: what if sheetname contains exclamation mark? |
|
1126 | + $explodes = explode('!', $range); // FIXME: what if sheetname contains exclamation mark? |
|
1127 | 1127 | $sheetName = trim($explodes[0], "'"); |
1128 | 1128 | if (count($explodes) == 2) { |
1129 | 1129 | if (strpos($explodes[1], ':') === false) { |
@@ -1306,7 +1306,7 @@ discard block |
||
1306 | 1306 | $secLength = self::getInt4d($this->summaryInformation, $secOffset); |
1307 | 1307 | |
1308 | 1308 | // offset: $secOffset+4; size: 4; property count |
1309 | - $countProperties = self::getInt4d($this->summaryInformation, $secOffset+4); |
|
1309 | + $countProperties = self::getInt4d($this->summaryInformation, $secOffset + 4); |
|
1310 | 1310 | |
1311 | 1311 | // initialize code page (used to resolve string values) |
1312 | 1312 | $codePage = 'CP1252'; |
@@ -1315,11 +1315,11 @@ discard block |
||
1315 | 1315 | // loop through property decarations and properties |
1316 | 1316 | for ($i = 0; $i < $countProperties; ++$i) { |
1317 | 1317 | // offset: ($secOffset+8) + (8 * $i); size: 4; property ID |
1318 | - $id = self::getInt4d($this->summaryInformation, ($secOffset+8) + (8 * $i)); |
|
1318 | + $id = self::getInt4d($this->summaryInformation, ($secOffset + 8) + (8 * $i)); |
|
1319 | 1319 | |
1320 | 1320 | // Use value of property id as appropriate |
1321 | 1321 | // offset: ($secOffset+12) + (8 * $i); size: 4; offset from beginning of section (48) |
1322 | - $offset = self::getInt4d($this->summaryInformation, ($secOffset+12) + (8 * $i)); |
|
1322 | + $offset = self::getInt4d($this->summaryInformation, ($secOffset + 12) + (8 * $i)); |
|
1323 | 1323 | |
1324 | 1324 | $type = self::getInt4d($this->summaryInformation, $secOffset + $offset); |
1325 | 1325 | |
@@ -1444,7 +1444,7 @@ discard block |
||
1444 | 1444 | // echo '$secLength = ', $secLength,'<br />'; |
1445 | 1445 | |
1446 | 1446 | // offset: $secOffset+4; size: 4; property count |
1447 | - $countProperties = self::getInt4d($this->documentSummaryInformation, $secOffset+4); |
|
1447 | + $countProperties = self::getInt4d($this->documentSummaryInformation, $secOffset + 4); |
|
1448 | 1448 | // echo '$countProperties = ', $countProperties,'<br />'; |
1449 | 1449 | |
1450 | 1450 | // initialize code page (used to resolve string values) |
@@ -1455,12 +1455,12 @@ discard block |
||
1455 | 1455 | for ($i = 0; $i < $countProperties; ++$i) { |
1456 | 1456 | // echo 'Property ', $i,'<br />'; |
1457 | 1457 | // offset: ($secOffset+8) + (8 * $i); size: 4; property ID |
1458 | - $id = self::getInt4d($this->documentSummaryInformation, ($secOffset+8) + (8 * $i)); |
|
1458 | + $id = self::getInt4d($this->documentSummaryInformation, ($secOffset + 8) + (8 * $i)); |
|
1459 | 1459 | // echo 'ID is ', $id,'<br />'; |
1460 | 1460 | |
1461 | 1461 | // Use value of property id as appropriate |
1462 | 1462 | // offset: 60 + 8 * $i; size: 4; offset from beginning of section (48) |
1463 | - $offset = self::getInt4d($this->documentSummaryInformation, ($secOffset+12) + (8 * $i)); |
|
1463 | + $offset = self::getInt4d($this->documentSummaryInformation, ($secOffset + 12) + (8 * $i)); |
|
1464 | 1464 | |
1465 | 1465 | $type = self::getInt4d($this->documentSummaryInformation, $secOffset + $offset); |
1466 | 1466 | // echo 'Type is ', $type,', '; |
@@ -1618,7 +1618,7 @@ discard block |
||
1618 | 1618 | // Concatenate this extension with the currently set comment for the cell |
1619 | 1619 | $comment = $this->phpSheet->getComment($cellAddress); |
1620 | 1620 | $commentText = $comment->getText()->getPlainText(); |
1621 | - $comment->setText($this->parseRichText($commentText.$noteText)); |
|
1621 | + $comment->setText($this->parseRichText($commentText . $noteText)); |
|
1622 | 1622 | } else { |
1623 | 1623 | // Set comment for the cell |
1624 | 1624 | $this->phpSheet->getComment($cellAddress)->setText($this->parseRichText($noteText)); |
@@ -1656,7 +1656,7 @@ discard block |
||
1656 | 1656 | $text = $this->getSplicedRecordData(); |
1657 | 1657 | |
1658 | 1658 | $this->textObjects[$this->textObjRef] = array( |
1659 | - 'text' => substr($text["recordData"], $text["spliceOffsets"][0]+1, $cchText), |
|
1659 | + 'text' => substr($text["recordData"], $text["spliceOffsets"][0] + 1, $cchText), |
|
1660 | 1660 | 'format' => substr($text["recordData"], $text["spliceOffsets"][1], $cbRuns), |
1661 | 1661 | 'alignment' => $grbitOpts, |
1662 | 1662 | 'rotation' => $rot |
@@ -2871,7 +2871,7 @@ discard block |
||
2871 | 2871 | ++$pos; |
2872 | 2872 | |
2873 | 2873 | // bit: 0; mask: 0x01; 0 = compressed; 1 = uncompressed |
2874 | - $isCompressed = (($optionFlags & 0x01) == 0) ; |
|
2874 | + $isCompressed = (($optionFlags & 0x01) == 0); |
|
2875 | 2875 | |
2876 | 2876 | // bit: 2; mask: 0x02; 0 = ordinary; 1 = Asian phonetic |
2877 | 2877 | $hasAsian = (($optionFlags & 0x04) != 0); |
@@ -3385,7 +3385,7 @@ discard block |
||
3385 | 3385 | |
3386 | 3386 | // bit 0, mask 0x01; 1 = sheet is protected |
3387 | 3387 | $bool = (0x01 & self::getInt2d($recordData, 0)) >> 0; |
3388 | - $this->phpSheet->getProtection()->setSheet((bool)$bool); |
|
3388 | + $this->phpSheet->getProtection()->setSheet((bool) $bool); |
|
3389 | 3389 | } |
3390 | 3390 | |
3391 | 3391 | |
@@ -3409,7 +3409,7 @@ discard block |
||
3409 | 3409 | // bit: 0, mask 0x01; 1 = scenarios are protected |
3410 | 3410 | $bool = (0x01 & self::getInt2d($recordData, 0)) >> 0; |
3411 | 3411 | |
3412 | - $this->phpSheet->getProtection()->setScenarios((bool)$bool); |
|
3412 | + $this->phpSheet->getProtection()->setScenarios((bool) $bool); |
|
3413 | 3413 | } |
3414 | 3414 | |
3415 | 3415 | |
@@ -3433,7 +3433,7 @@ discard block |
||
3433 | 3433 | // bit: 0, mask 0x01; 1 = objects are protected |
3434 | 3434 | $bool = (0x01 & self::getInt2d($recordData, 0)) >> 0; |
3435 | 3435 | |
3436 | - $this->phpSheet->getProtection()->setObjects((bool)$bool); |
|
3436 | + $this->phpSheet->getProtection()->setObjects((bool) $bool); |
|
3437 | 3437 | } |
3438 | 3438 | |
3439 | 3439 | |
@@ -3869,7 +3869,7 @@ discard block |
||
3869 | 3869 | // get the base cell, grab tExp token |
3870 | 3870 | $baseRow = self::getInt2d($formulaStructure, 3); |
3871 | 3871 | $baseCol = self::getInt2d($formulaStructure, 5); |
3872 | - $this->_baseCell = \PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol). ($baseRow + 1); |
|
3872 | + $this->_baseCell = \PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol) . ($baseRow + 1); |
|
3873 | 3873 | } |
3874 | 3874 | |
3875 | 3875 | // Read cell? |
@@ -4298,7 +4298,7 @@ discard block |
||
4298 | 4298 | $this->frozen = (bool) ((0x0008 & $options) >> 3); |
4299 | 4299 | |
4300 | 4300 | // bit: 6; mask: 0x0040; 0 = columns from left to right, 1 = columns from right to left |
4301 | - $this->phpSheet->setRightToLeft((bool)((0x0040 & $options) >> 6)); |
|
4301 | + $this->phpSheet->setRightToLeft((bool) ((0x0040 & $options) >> 6)); |
|
4302 | 4302 | |
4303 | 4303 | // bit: 10; mask: 0x0400; 0 = sheet not active, 1 = sheet active |
4304 | 4304 | $isActive = (bool) ((0x0400 & $options) >> 10); |
@@ -4873,9 +4873,9 @@ discard block |
||
4873 | 4873 | $objValidation = $this->phpSheet->getCell($coordinate)->getDataValidation(); |
4874 | 4874 | $objValidation->setType($type); |
4875 | 4875 | $objValidation->setErrorStyle($errorStyle); |
4876 | - $objValidation->setAllowBlank((bool)$allowBlank); |
|
4877 | - $objValidation->setShowInputMessage((bool)$showInputMessage); |
|
4878 | - $objValidation->setShowErrorMessage((bool)$showErrorMessage); |
|
4876 | + $objValidation->setAllowBlank((bool) $allowBlank); |
|
4877 | + $objValidation->setShowInputMessage((bool) $showInputMessage); |
|
4878 | + $objValidation->setShowErrorMessage((bool) $showErrorMessage); |
|
4879 | 4879 | $objValidation->setShowDropDown(!$suppressDropDown); |
4880 | 4880 | $objValidation->setOperator($operator); |
4881 | 4881 | $objValidation->setErrorTitle($errorTitle); |
@@ -5700,7 +5700,7 @@ discard block |
||
5700 | 5700 | $name = 'tNum'; |
5701 | 5701 | $size = 9; |
5702 | 5702 | $data = self::extractNumber(substr($formulaData, 1)); |
5703 | - $data = str_replace(',', '.', (string)$data); // in case non-English locale |
|
5703 | + $data = str_replace(',', '.', (string) $data); // in case non-English locale |
|
5704 | 5704 | break; |
5705 | 5705 | case 0x20: // array constant |
5706 | 5706 | case 0x40: |
@@ -7470,7 +7470,7 @@ discard block |
||
7470 | 7470 | $sign = ($rknum & 0x80000000) >> 31; |
7471 | 7471 | $exp = ($rknum & 0x7ff00000) >> 20; |
7472 | 7472 | $mantissa = (0x100000 | ($rknum & 0x000ffffc)); |
7473 | - $value = $mantissa / pow(2, (20- ($exp - 1023))); |
|
7473 | + $value = $mantissa / pow(2, (20 - ($exp - 1023))); |
|
7474 | 7474 | if ($sign) { |
7475 | 7475 | $value = -1 * $value; |
7476 | 7476 | } |
@@ -7539,7 +7539,7 @@ discard block |
||
7539 | 7539 | */ |
7540 | 7540 | public static function getInt2d($data, $pos) |
7541 | 7541 | { |
7542 | - return ord($data[$pos]) | (ord($data[$pos+1]) << 8); |
|
7542 | + return ord($data[$pos]) | (ord($data[$pos + 1]) << 8); |
|
7543 | 7543 | } |
7544 | 7544 | |
7545 | 7545 | |
@@ -7562,7 +7562,7 @@ discard block |
||
7562 | 7562 | } else { |
7563 | 7563 | $_ord_24 = ($_or_24 & 127) << 24; |
7564 | 7564 | } |
7565 | - return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | $_ord_24; |
|
7565 | + return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | (ord($data[$pos + 2]) << 16) | $_ord_24; |
|
7566 | 7566 | } |
7567 | 7567 | |
7568 | 7568 |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | } |
219 | 219 | $spreadsheet->setActiveSheetIndex($this->sheetIndex); |
220 | 220 | |
221 | - $fromFormats = array('\-', '\ '); |
|
222 | - $toFormats = array('-', ' '); |
|
221 | + $fromFormats = array('\-', '\ '); |
|
222 | + $toFormats = array('-', ' '); |
|
223 | 223 | |
224 | 224 | // Loop through file |
225 | 225 | $rowData = array(); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | break; |
253 | 253 | case 'S': |
254 | 254 | $styleSettings = substr($rowDatum, 1); |
255 | - for ($i=0; $i<strlen($styleSettings); ++$i) { |
|
255 | + for ($i = 0; $i < strlen($styleSettings); ++$i) { |
|
256 | 256 | switch ($styleSettings{$i}) { |
257 | 257 | case 'I': |
258 | 258 | $formatArray['font']['italic'] = true; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | break; |
278 | 278 | } |
279 | 279 | } |
280 | - $this->formats['P'.$this->format++] = $formatArray; |
|
280 | + $this->formats['P' . $this->format++] = $formatArray; |
|
281 | 281 | // Read cell value data |
282 | 282 | } elseif ($dataType == 'C') { |
283 | 283 | $hasCalculatedValue = false; |
@@ -296,14 +296,14 @@ discard block |
||
296 | 296 | $cellData = substr($rowDatum, 1); |
297 | 297 | break; |
298 | 298 | case 'E': |
299 | - $cellDataFormula = '='.substr($rowDatum, 1); |
|
299 | + $cellDataFormula = '=' . substr($rowDatum, 1); |
|
300 | 300 | // Convert R1C1 style references to A1 style references (but only when not quoted) |
301 | 301 | $temp = explode('"', $cellDataFormula); |
302 | 302 | $key = false; |
303 | 303 | foreach ($temp as &$value) { |
304 | 304 | // Only count/replace in alternate array entries |
305 | 305 | if ($key = !$key) { |
306 | - preg_match_all('/(R(\[?-?\d*\]?))(C(\[?-?\d*\]?))/', $value, $cellReferences, PREG_SET_ORDER+PREG_OFFSET_CAPTURE); |
|
306 | + preg_match_all('/(R(\[?-?\d*\]?))(C(\[?-?\d*\]?))/', $value, $cellReferences, PREG_SET_ORDER + PREG_OFFSET_CAPTURE); |
|
307 | 307 | // Reverse the matches array, otherwise all our offsets will become incorrect if we modify our way |
308 | 308 | // through the formula from left to right. Reversing means that we work right to left.through |
309 | 309 | // the formula |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | if ($columnReference{0} == '[') { |
330 | 330 | $columnReference = $column + trim($columnReference, '[]'); |
331 | 331 | } |
332 | - $A1CellReference = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference-1).$rowReference; |
|
332 | + $A1CellReference = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference - 1) . $rowReference; |
|
333 | 333 | |
334 | 334 | $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0])); |
335 | 335 | } |
@@ -342,14 +342,14 @@ discard block |
||
342 | 342 | break; |
343 | 343 | } |
344 | 344 | } |
345 | - $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1); |
|
345 | + $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column - 1); |
|
346 | 346 | $cellData = \PhpSpreadsheet\Calculation::unwrapResult($cellData); |
347 | 347 | |
348 | 348 | // Set cell value |
349 | - $spreadsheet->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData); |
|
349 | + $spreadsheet->getActiveSheet()->getCell($columnLetter . $row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData); |
|
350 | 350 | if ($hasCalculatedValue) { |
351 | 351 | $cellData = \PhpSpreadsheet\Calculation::unwrapResult($cellData); |
352 | - $spreadsheet->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData); |
|
352 | + $spreadsheet->getActiveSheet()->getCell($columnLetter . $row)->setCalculatedValue($cellData); |
|
353 | 353 | } |
354 | 354 | // Read cell formatting |
355 | 355 | } elseif ($dataType == 'F') { |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | break; |
374 | 374 | case 'S': |
375 | 375 | $styleSettings = substr($rowDatum, 1); |
376 | - for ($i=0; $i<strlen($styleSettings); ++$i) { |
|
376 | + for ($i = 0; $i < strlen($styleSettings); ++$i) { |
|
377 | 377 | switch ($styleSettings{$i}) { |
378 | 378 | case 'I': |
379 | 379 | $styleData['font']['italic'] = true; |
@@ -399,22 +399,22 @@ discard block |
||
399 | 399 | } |
400 | 400 | } |
401 | 401 | if (($formatStyle > '') && ($column > '') && ($row > '')) { |
402 | - $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1); |
|
402 | + $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column - 1); |
|
403 | 403 | if (isset($this->formats[$formatStyle])) { |
404 | - $spreadsheet->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->formats[$formatStyle]); |
|
404 | + $spreadsheet->getActiveSheet()->getStyle($columnLetter . $row)->applyFromArray($this->formats[$formatStyle]); |
|
405 | 405 | } |
406 | 406 | } |
407 | 407 | if ((!empty($styleData)) && ($column > '') && ($row > '')) { |
408 | - $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1); |
|
409 | - $spreadsheet->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($styleData); |
|
408 | + $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column - 1); |
|
409 | + $spreadsheet->getActiveSheet()->getStyle($columnLetter . $row)->applyFromArray($styleData); |
|
410 | 410 | } |
411 | 411 | if ($columnWidth > '') { |
412 | 412 | if ($startCol == $endCol) { |
413 | - $startCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCol-1); |
|
413 | + $startCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCol - 1); |
|
414 | 414 | $spreadsheet->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); |
415 | 415 | } else { |
416 | - $startCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCol-1); |
|
417 | - $endCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($endCol-1); |
|
416 | + $startCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCol - 1); |
|
417 | + $endCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($endCol - 1); |
|
418 | 418 | $spreadsheet->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); |
419 | 419 | do { |
420 | 420 | $spreadsheet->getActiveSheet()->getColumnDimension(++$startCol)->setWidth($columnWidth); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function __construct() |
40 | 40 | { |
41 | - $this->readFilter = new DefaultReadFilter(); |
|
41 | + $this->readFilter = new DefaultReadFilter(); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | $xml = new XMLReader(); |
124 | 124 | $res = $xml->xml( |
125 | - $this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'), |
|
125 | + $this->securityScanFile('zip://' . realpath($pFilename) . '#content.xml'), |
|
126 | 126 | null, |
127 | 127 | \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
128 | 128 | ); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | |
179 | 179 | $xml = new XMLReader(); |
180 | 180 | $res = $xml->xml( |
181 | - $this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'), |
|
181 | + $this->securityScanFile('zip://' . realpath($pFilename) . '#content.xml'), |
|
182 | 182 | null, |
183 | 183 | \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
184 | 184 | ); |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | foreach ($annotationText as $t) { |
516 | 516 | if (isset($t->span)) { |
517 | 517 | foreach ($t->span as $text) { |
518 | - $textArray[] = (string)$text; |
|
518 | + $textArray[] = (string) $text; |
|
519 | 519 | } |
520 | 520 | } else { |
521 | 521 | $textArray[] = (string) $t; |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | } |
524 | 524 | $text = implode("\n", $textArray); |
525 | 525 | // echo $text, '<br />'; |
526 | - $spreadsheet->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text)); |
|
526 | + $spreadsheet->getActiveSheet()->getComment($columnID . $rowID)->setText($this->parseRichText($text)); |
|
527 | 527 | // ->setAuthor( $author ) |
528 | 528 | } |
529 | 529 | |
@@ -597,14 +597,14 @@ discard block |
||
597 | 597 | list($year, $month, $day, $hour, $minute, $second) = explode(' ', $dateObj->format('Y m d H i s')); |
598 | 598 | $dataValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel($year, $month, $day, $hour, $minute, $second); |
599 | 599 | if ($dataValue != floor($dataValue)) { |
600 | - $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15.' '.\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; |
|
600 | + $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15 . ' ' . \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; |
|
601 | 601 | } else { |
602 | 602 | $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15; |
603 | 603 | } |
604 | 604 | break; |
605 | 605 | case 'time': |
606 | 606 | $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; |
607 | - $dataValue = \PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS')))); |
|
607 | + $dataValue = \PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime('01-01-1970 ' . implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS')))); |
|
608 | 608 | $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; |
609 | 609 | break; |
610 | 610 | } |
@@ -620,16 +620,16 @@ discard block |
||
620 | 620 | if ($hasCalculatedValue) { |
621 | 621 | $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; |
622 | 622 | // echo 'Formula: ', $cellDataFormula, PHP_EOL; |
623 | - $cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=')+1); |
|
623 | + $cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=') + 1); |
|
624 | 624 | $temp = explode('"', $cellDataFormula); |
625 | 625 | $tKey = false; |
626 | 626 | foreach ($temp as &$value) { |
627 | 627 | // Only replace in alternate array entries (i.e. non-quoted blocks) |
628 | 628 | if ($tKey = !$tKey) { |
629 | - $value = preg_replace('/\[([^\.]+)\.([^\.]+):\.([^\.]+)\]/Ui', '$1!$2:$3', $value); // Cell range reference in another sheet |
|
630 | - $value = preg_replace('/\[([^\.]+)\.([^\.]+)\]/Ui', '$1!$2', $value); // Cell reference in another sheet |
|
631 | - $value = preg_replace('/\[\.([^\.]+):\.([^\.]+)\]/Ui', '$1:$2', $value); // Cell range reference |
|
632 | - $value = preg_replace('/\[\.([^\.]+)\]/Ui', '$1', $value); // Simple cell reference |
|
629 | + $value = preg_replace('/\[([^\.]+)\.([^\.]+):\.([^\.]+)\]/Ui', '$1!$2:$3', $value); // Cell range reference in another sheet |
|
630 | + $value = preg_replace('/\[([^\.]+)\.([^\.]+)\]/Ui', '$1!$2', $value); // Cell reference in another sheet |
|
631 | + $value = preg_replace('/\[\.([^\.]+):\.([^\.]+)\]/Ui', '$1:$2', $value); // Cell range reference |
|
632 | + $value = preg_replace('/\[\.([^\.]+)\]/Ui', '$1', $value); // Simple cell reference |
|
633 | 633 | $value = \PhpSpreadsheet\Calculation::translateSeparator(';', ',', $value, $inBraces); |
634 | 634 | } |
635 | 635 | } |
@@ -648,18 +648,18 @@ discard block |
||
648 | 648 | if ($type !== \PhpSpreadsheet\Cell\DataType::TYPE_NULL) { |
649 | 649 | for ($rowAdjust = 0; $rowAdjust < $rowRepeats; ++$rowAdjust) { |
650 | 650 | $rID = $rowID + $rowAdjust; |
651 | - $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type); |
|
651 | + $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type); |
|
652 | 652 | if ($hasCalculatedValue) { |
653 | 653 | // echo 'Forumla result is '.$dataValue.'<br />'; |
654 | - $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->setCalculatedValue($dataValue); |
|
654 | + $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->setCalculatedValue($dataValue); |
|
655 | 655 | } |
656 | 656 | if ($formatting !== null) { |
657 | - $spreadsheet->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode($formatting); |
|
657 | + $spreadsheet->getActiveSheet()->getStyle($columnID . $rID)->getNumberFormat()->setFormatCode($formatting); |
|
658 | 658 | } else { |
659 | - $spreadsheet->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL); |
|
659 | + $spreadsheet->getActiveSheet()->getStyle($columnID . $rID)->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL); |
|
660 | 660 | } |
661 | 661 | if ($hyperlink !== null) { |
662 | - $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->getHyperlink()->setUrl($hyperlink); |
|
662 | + $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->getHyperlink()->setUrl($hyperlink); |
|
663 | 663 | } |
664 | 664 | } |
665 | 665 | } |
@@ -671,13 +671,13 @@ discard block |
||
671 | 671 | if (($type !== \PhpSpreadsheet\Cell\DataType::TYPE_NULL) || (!$this->readDataOnly)) { |
672 | 672 | $columnTo = $columnID; |
673 | 673 | if (isset($cellDataTableAttributes['number-columns-spanned'])) { |
674 | - $columnTo = \PhpSpreadsheet\Cell::stringFromColumnIndex(\PhpSpreadsheet\Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] -2); |
|
674 | + $columnTo = \PhpSpreadsheet\Cell::stringFromColumnIndex(\PhpSpreadsheet\Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] - 2); |
|
675 | 675 | } |
676 | 676 | $rowTo = $rowID; |
677 | 677 | if (isset($cellDataTableAttributes['number-rows-spanned'])) { |
678 | 678 | $rowTo = $rowTo + $cellDataTableAttributes['number-rows-spanned'] - 1; |
679 | 679 | } |
680 | - $cellRange = $columnID.$rowID.':'.$columnTo.$rowTo; |
|
680 | + $cellRange = $columnID . $rowID . ':' . $columnTo . $rowTo; |
|
681 | 681 | $spreadsheet->getActiveSheet()->mergeCells($cellRange); |
682 | 682 | } |
683 | 683 | } |
@@ -285,20 +285,20 @@ discard block |
||
285 | 285 | $fromFormats = array('\-', '\ '); |
286 | 286 | $toFormats = array('-', ' '); |
287 | 287 | |
288 | - $underlineStyles = array ( |
|
288 | + $underlineStyles = array( |
|
289 | 289 | \PhpSpreadsheet\Style\Font::UNDERLINE_NONE, |
290 | 290 | \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE, |
291 | 291 | \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING, |
292 | 292 | \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE, |
293 | 293 | \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING |
294 | 294 | ); |
295 | - $verticalAlignmentStyles = array ( |
|
295 | + $verticalAlignmentStyles = array( |
|
296 | 296 | \PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM, |
297 | 297 | \PhpSpreadsheet\Style\Alignment::VERTICAL_TOP, |
298 | 298 | \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER, |
299 | 299 | \PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY |
300 | 300 | ); |
301 | - $horizontalAlignmentStyles = array ( |
|
301 | + $horizontalAlignmentStyles = array( |
|
302 | 302 | \PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL, |
303 | 303 | \PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT, |
304 | 304 | \PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT, |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | foreach ($worksheet->Table->Column as $columnData) { |
553 | 553 | $columnData_ss = $columnData->attributes($namespaces['ss']); |
554 | 554 | if (isset($columnData_ss['Index'])) { |
555 | - $columnID = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnData_ss['Index']-1); |
|
555 | + $columnID = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnData_ss['Index'] - 1); |
|
556 | 556 | } |
557 | 557 | if (isset($columnData_ss['Width'])) { |
558 | 558 | $columnWidth = $columnData_ss['Width']; |
@@ -578,9 +578,9 @@ discard block |
||
578 | 578 | foreach ($rowData->Cell as $cell) { |
579 | 579 | $cell_ss = $cell->attributes($namespaces['ss']); |
580 | 580 | if (isset($cell_ss['Index'])) { |
581 | - $columnID = \PhpSpreadsheet\Cell::stringFromColumnIndex($cell_ss['Index']-1); |
|
581 | + $columnID = \PhpSpreadsheet\Cell::stringFromColumnIndex($cell_ss['Index'] - 1); |
|
582 | 582 | } |
583 | - $cellRange = $columnID.$rowID; |
|
583 | + $cellRange = $columnID . $rowID; |
|
584 | 584 | |
585 | 585 | if ($this->getReadFilter() !== null) { |
586 | 586 | if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) { |
@@ -591,14 +591,14 @@ discard block |
||
591 | 591 | if ((isset($cell_ss['MergeAcross'])) || (isset($cell_ss['MergeDown']))) { |
592 | 592 | $columnTo = $columnID; |
593 | 593 | if (isset($cell_ss['MergeAcross'])) { |
594 | - $additionalMergedCells += (int)$cell_ss['MergeAcross']; |
|
595 | - $columnTo = \PhpSpreadsheet\Cell::stringFromColumnIndex(\PhpSpreadsheet\Cell::columnIndexFromString($columnID) + $cell_ss['MergeAcross'] -1); |
|
594 | + $additionalMergedCells += (int) $cell_ss['MergeAcross']; |
|
595 | + $columnTo = \PhpSpreadsheet\Cell::stringFromColumnIndex(\PhpSpreadsheet\Cell::columnIndexFromString($columnID) + $cell_ss['MergeAcross'] - 1); |
|
596 | 596 | } |
597 | 597 | $rowTo = $rowID; |
598 | 598 | if (isset($cell_ss['MergeDown'])) { |
599 | 599 | $rowTo = $rowTo + $cell_ss['MergeDown']; |
600 | 600 | } |
601 | - $cellRange .= ':'.$columnTo.$rowTo; |
|
601 | + $cellRange .= ':' . $columnTo . $rowTo; |
|
602 | 602 | $spreadsheet->getActiveSheet()->mergeCells($cellRange); |
603 | 603 | } |
604 | 604 | |
@@ -703,7 +703,7 @@ discard block |
||
703 | 703 | if ($columnReference{0} == '[') { |
704 | 704 | $columnReference = $columnNumber + trim($columnReference, '[]'); |
705 | 705 | } |
706 | - $A1CellReference = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference-1).$rowReference; |
|
706 | + $A1CellReference = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference - 1) . $rowReference; |
|
707 | 707 | $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0])); |
708 | 708 | } |
709 | 709 | } |
@@ -717,10 +717,10 @@ discard block |
||
717 | 717 | |
718 | 718 | // echo 'Cell '.$columnID.$rowID.' is a '.$type.' with a value of '.(($hasCalculatedValue) ? $cellDataFormula : $cellValue).'<br />'; |
719 | 719 | // |
720 | - $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type); |
|
720 | + $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type); |
|
721 | 721 | if ($hasCalculatedValue) { |
722 | 722 | // echo 'Formula result is '.$cellValue.'<br />'; |
723 | - $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue); |
|
723 | + $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setCalculatedValue($cellValue); |
|
724 | 724 | } |
725 | 725 | $cellIsSet = $rowHasData = true; |
726 | 726 | } |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | $commentAttributes = $cell->Comment->attributes($namespaces['ss']); |
731 | 731 | $author = 'unknown'; |
732 | 732 | if (isset($commentAttributes->Author)) { |
733 | - $author = (string)$commentAttributes->Author; |
|
733 | + $author = (string) $commentAttributes->Author; |
|
734 | 734 | // echo 'Author: ', $author,'<br />'; |
735 | 735 | } |
736 | 736 | $node = $cell->Comment->Data->asXML(); |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | // echo $annotation,'<br />'; |
739 | 739 | $annotation = strip_tags($node); |
740 | 740 | // echo 'Annotation: ', $annotation,'<br />'; |
741 | - $spreadsheet->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation)); |
|
741 | + $spreadsheet->getActiveSheet()->getComment($columnID . $rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation)); |
|
742 | 742 | } |
743 | 743 | |
744 | 744 | if (($cellIsSet) && (isset($cell_ss['StyleID']))) { |
@@ -748,8 +748,8 @@ discard block |
||
748 | 748 | // echo 'Cell '.$columnID.$rowID.'<br />'; |
749 | 749 | // print_r($this->styles[$style]); |
750 | 750 | // echo '<br />'; |
751 | - if (!$spreadsheet->getActiveSheet()->cellExists($columnID.$rowID)) { |
|
752 | - $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setValue(null); |
|
751 | + if (!$spreadsheet->getActiveSheet()->cellExists($columnID . $rowID)) { |
|
752 | + $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setValue(null); |
|
753 | 753 | } |
754 | 754 | $spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]); |
755 | 755 | } |
@@ -566,49 +566,49 @@ discard block |
||
566 | 566 | |
567 | 567 | // GKPIDDSI_CODEPAGE: CodePage |
568 | 568 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x01), |
569 | - 'offset' => array('pack' => 'V'), |
|
570 | - 'type' => array('pack' => 'V', 'data' => 0x02), // 2 byte signed integer |
|
571 | - 'data' => array('data' => 1252)); |
|
569 | + 'offset' => array('pack' => 'V'), |
|
570 | + 'type' => array('pack' => 'V', 'data' => 0x02), // 2 byte signed integer |
|
571 | + 'data' => array('data' => 1252)); |
|
572 | 572 | $dataSection_NumProps++; |
573 | 573 | |
574 | 574 | // GKPIDDSI_CATEGORY : Category |
575 | 575 | if ($this->spreadsheet->getProperties()->getCategory()) { |
576 | 576 | $dataProp = $this->spreadsheet->getProperties()->getCategory(); |
577 | 577 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02), |
578 | - 'offset' => array('pack' => 'V'), |
|
579 | - 'type' => array('pack' => 'V', 'data' => 0x1E), |
|
580 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
578 | + 'offset' => array('pack' => 'V'), |
|
579 | + 'type' => array('pack' => 'V', 'data' => 0x1E), |
|
580 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
581 | 581 | $dataSection_NumProps++; |
582 | 582 | } |
583 | 583 | // GKPIDDSI_VERSION :Version of the application that wrote the property storage |
584 | 584 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x17), |
585 | - 'offset' => array('pack' => 'V'), |
|
586 | - 'type' => array('pack' => 'V', 'data' => 0x03), |
|
587 | - 'data' => array('pack' => 'V', 'data' => 0x000C0000)); |
|
585 | + 'offset' => array('pack' => 'V'), |
|
586 | + 'type' => array('pack' => 'V', 'data' => 0x03), |
|
587 | + 'data' => array('pack' => 'V', 'data' => 0x000C0000)); |
|
588 | 588 | $dataSection_NumProps++; |
589 | 589 | // GKPIDDSI_SCALE : FALSE |
590 | 590 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0B), |
591 | - 'offset' => array('pack' => 'V'), |
|
592 | - 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
593 | - 'data' => array('data' => false)); |
|
591 | + 'offset' => array('pack' => 'V'), |
|
592 | + 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
593 | + 'data' => array('data' => false)); |
|
594 | 594 | $dataSection_NumProps++; |
595 | 595 | // GKPIDDSI_LINKSDIRTY : True if any of the values for the linked properties have changed outside of the application |
596 | 596 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x10), |
597 | - 'offset' => array('pack' => 'V'), |
|
598 | - 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
599 | - 'data' => array('data' => false)); |
|
597 | + 'offset' => array('pack' => 'V'), |
|
598 | + 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
599 | + 'data' => array('data' => false)); |
|
600 | 600 | $dataSection_NumProps++; |
601 | 601 | // GKPIDDSI_SHAREDOC : FALSE |
602 | 602 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x13), |
603 | - 'offset' => array('pack' => 'V'), |
|
604 | - 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
605 | - 'data' => array('data' => false)); |
|
603 | + 'offset' => array('pack' => 'V'), |
|
604 | + 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
605 | + 'data' => array('data' => false)); |
|
606 | 606 | $dataSection_NumProps++; |
607 | 607 | // GKPIDDSI_HYPERLINKSCHANGED : True if any of the values for the _PID_LINKS (hyperlink text) have changed outside of the application |
608 | 608 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x16), |
609 | - 'offset' => array('pack' => 'V'), |
|
610 | - 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
611 | - 'data' => array('data' => false)); |
|
609 | + 'offset' => array('pack' => 'V'), |
|
610 | + 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
611 | + 'data' => array('data' => false)); |
|
612 | 612 | $dataSection_NumProps++; |
613 | 613 | |
614 | 614 | // GKPIDDSI_DOCSPARTS |
@@ -618,50 +618,50 @@ discard block |
||
618 | 618 | $dataProp = pack('v', 0x0001); |
619 | 619 | $dataProp .= pack('v', 0x0000); |
620 | 620 | // array of UnalignedLpstr |
621 | - // cch |
|
622 | - $dataProp .= pack('v', 0x000A); |
|
623 | - $dataProp .= pack('v', 0x0000); |
|
624 | - // value |
|
625 | - $dataProp .= 'Worksheet'.chr(0); |
|
621 | + // cch |
|
622 | + $dataProp .= pack('v', 0x000A); |
|
623 | + $dataProp .= pack('v', 0x0000); |
|
624 | + // value |
|
625 | + $dataProp .= 'Worksheet'.chr(0); |
|
626 | 626 | |
627 | 627 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D), |
628 | - 'offset' => array('pack' => 'V'), |
|
629 | - 'type' => array('pack' => 'V', 'data' => 0x101E), |
|
630 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
628 | + 'offset' => array('pack' => 'V'), |
|
629 | + 'type' => array('pack' => 'V', 'data' => 0x101E), |
|
630 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
631 | 631 | $dataSection_NumProps++; |
632 | 632 | |
633 | 633 | // GKPIDDSI_HEADINGPAIR |
634 | 634 | // VtVecHeadingPairValue |
635 | - // cElements |
|
636 | - $dataProp = pack('v', 0x0002); |
|
637 | - $dataProp .= pack('v', 0x0000); |
|
638 | - // Array of vtHeadingPair |
|
635 | + // cElements |
|
636 | + $dataProp = pack('v', 0x0002); |
|
637 | + $dataProp .= pack('v', 0x0000); |
|
638 | + // Array of vtHeadingPair |
|
639 | 639 | // vtUnalignedString - headingString |
640 | - // stringType |
|
641 | - $dataProp .= pack('v', 0x001E); |
|
642 | - // padding |
|
643 | - $dataProp .= pack('v', 0x0000); |
|
644 | - // UnalignedLpstr |
|
640 | + // stringType |
|
641 | + $dataProp .= pack('v', 0x001E); |
|
642 | + // padding |
|
643 | + $dataProp .= pack('v', 0x0000); |
|
644 | + // UnalignedLpstr |
|
645 | 645 | // cch |
646 | 646 | $dataProp .= pack('v', 0x0013); |
647 | 647 | $dataProp .= pack('v', 0x0000); |
648 | 648 | // value |
649 | 649 | $dataProp .= 'Feuilles de calcul'; |
650 | 650 | // vtUnalignedString - headingParts |
651 | - // wType : 0x0003 = 32 bit signed integer |
|
652 | - $dataProp .= pack('v', 0x0300); |
|
653 | - // padding |
|
654 | - $dataProp .= pack('v', 0x0000); |
|
655 | - // value |
|
656 | - $dataProp .= pack('v', 0x0100); |
|
657 | - $dataProp .= pack('v', 0x0000); |
|
658 | - $dataProp .= pack('v', 0x0000); |
|
659 | - $dataProp .= pack('v', 0x0000); |
|
651 | + // wType : 0x0003 = 32 bit signed integer |
|
652 | + $dataProp .= pack('v', 0x0300); |
|
653 | + // padding |
|
654 | + $dataProp .= pack('v', 0x0000); |
|
655 | + // value |
|
656 | + $dataProp .= pack('v', 0x0100); |
|
657 | + $dataProp .= pack('v', 0x0000); |
|
658 | + $dataProp .= pack('v', 0x0000); |
|
659 | + $dataProp .= pack('v', 0x0000); |
|
660 | 660 | |
661 | 661 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C), |
662 | - 'offset' => array('pack' => 'V'), |
|
663 | - 'type' => array('pack' => 'V', 'data' => 0x100C), |
|
664 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
662 | + 'offset' => array('pack' => 'V'), |
|
663 | + 'type' => array('pack' => 'V', 'data' => 0x100C), |
|
664 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
665 | 665 | $dataSection_NumProps++; |
666 | 666 | |
667 | 667 | // 4 Section Length |
@@ -762,88 +762,88 @@ discard block |
||
762 | 762 | |
763 | 763 | // CodePage : CP-1252 |
764 | 764 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x01), |
765 | - 'offset' => array('pack' => 'V'), |
|
766 | - 'type' => array('pack' => 'V', 'data' => 0x02), // 2 byte signed integer |
|
767 | - 'data' => array('data' => 1252)); |
|
765 | + 'offset' => array('pack' => 'V'), |
|
766 | + 'type' => array('pack' => 'V', 'data' => 0x02), // 2 byte signed integer |
|
767 | + 'data' => array('data' => 1252)); |
|
768 | 768 | $dataSection_NumProps++; |
769 | 769 | |
770 | 770 | // Title |
771 | 771 | if ($this->spreadsheet->getProperties()->getTitle()) { |
772 | 772 | $dataProp = $this->spreadsheet->getProperties()->getTitle(); |
773 | 773 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02), |
774 | - 'offset' => array('pack' => 'V'), |
|
775 | - 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
776 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
774 | + 'offset' => array('pack' => 'V'), |
|
775 | + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
776 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
777 | 777 | $dataSection_NumProps++; |
778 | 778 | } |
779 | 779 | // Subject |
780 | 780 | if ($this->spreadsheet->getProperties()->getSubject()) { |
781 | 781 | $dataProp = $this->spreadsheet->getProperties()->getSubject(); |
782 | 782 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x03), |
783 | - 'offset' => array('pack' => 'V'), |
|
784 | - 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
785 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
783 | + 'offset' => array('pack' => 'V'), |
|
784 | + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
785 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
786 | 786 | $dataSection_NumProps++; |
787 | 787 | } |
788 | 788 | // Author (Creator) |
789 | 789 | if ($this->spreadsheet->getProperties()->getCreator()) { |
790 | 790 | $dataProp = $this->spreadsheet->getProperties()->getCreator(); |
791 | 791 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x04), |
792 | - 'offset' => array('pack' => 'V'), |
|
793 | - 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
794 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
792 | + 'offset' => array('pack' => 'V'), |
|
793 | + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
794 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
795 | 795 | $dataSection_NumProps++; |
796 | 796 | } |
797 | 797 | // Keywords |
798 | 798 | if ($this->spreadsheet->getProperties()->getKeywords()) { |
799 | 799 | $dataProp = $this->spreadsheet->getProperties()->getKeywords(); |
800 | 800 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x05), |
801 | - 'offset' => array('pack' => 'V'), |
|
802 | - 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
803 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
801 | + 'offset' => array('pack' => 'V'), |
|
802 | + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
803 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
804 | 804 | $dataSection_NumProps++; |
805 | 805 | } |
806 | 806 | // Comments (Description) |
807 | 807 | if ($this->spreadsheet->getProperties()->getDescription()) { |
808 | 808 | $dataProp = $this->spreadsheet->getProperties()->getDescription(); |
809 | 809 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x06), |
810 | - 'offset' => array('pack' => 'V'), |
|
811 | - 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
812 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
810 | + 'offset' => array('pack' => 'V'), |
|
811 | + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
812 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
813 | 813 | $dataSection_NumProps++; |
814 | 814 | } |
815 | 815 | // Last Saved By (LastModifiedBy) |
816 | 816 | if ($this->spreadsheet->getProperties()->getLastModifiedBy()) { |
817 | 817 | $dataProp = $this->spreadsheet->getProperties()->getLastModifiedBy(); |
818 | 818 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x08), |
819 | - 'offset' => array('pack' => 'V'), |
|
820 | - 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
821 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
819 | + 'offset' => array('pack' => 'V'), |
|
820 | + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
821 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
822 | 822 | $dataSection_NumProps++; |
823 | 823 | } |
824 | 824 | // Created Date/Time |
825 | 825 | if ($this->spreadsheet->getProperties()->getCreated()) { |
826 | 826 | $dataProp = $this->spreadsheet->getProperties()->getCreated(); |
827 | 827 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C), |
828 | - 'offset' => array('pack' => 'V'), |
|
829 | - 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) |
|
830 | - 'data' => array('data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp))); |
|
828 | + 'offset' => array('pack' => 'V'), |
|
829 | + 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) |
|
830 | + 'data' => array('data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp))); |
|
831 | 831 | $dataSection_NumProps++; |
832 | 832 | } |
833 | 833 | // Modified Date/Time |
834 | 834 | if ($this->spreadsheet->getProperties()->getModified()) { |
835 | 835 | $dataProp = $this->spreadsheet->getProperties()->getModified(); |
836 | 836 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D), |
837 | - 'offset' => array('pack' => 'V'), |
|
838 | - 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) |
|
839 | - 'data' => array('data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp))); |
|
837 | + 'offset' => array('pack' => 'V'), |
|
838 | + 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) |
|
839 | + 'data' => array('data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp))); |
|
840 | 840 | $dataSection_NumProps++; |
841 | 841 | } |
842 | 842 | // Security |
843 | 843 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x13), |
844 | - 'offset' => array('pack' => 'V'), |
|
845 | - 'type' => array('pack' => 'V', 'data' => 0x03), // 4 byte signed integer |
|
846 | - 'data' => array('data' => 0x00)); |
|
844 | + 'offset' => array('pack' => 'V'), |
|
845 | + 'type' => array('pack' => 'V', 'data' => 0x03), // 4 byte signed integer |
|
846 | + 'data' => array('data' => 0x00)); |
|
847 | 847 | $dataSection_NumProps++; |
848 | 848 | |
849 | 849 |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | { |
101 | 101 | $this->spreadsheet = $spreadsheet; |
102 | 102 | |
103 | - $this->parser = new Excel5\Parser(); |
|
103 | + $this->parser = new Excel5\Parser(); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -338,9 +338,9 @@ discard block |
||
338 | 338 | ++$countShapes[$sheetIndex]; |
339 | 339 | |
340 | 340 | // create an Drawing Object for the dropdown |
341 | - $oDrawing = new \PhpSpreadsheet\Worksheet\BaseDrawing(); |
|
341 | + $oDrawing = new \PhpSpreadsheet\Worksheet\BaseDrawing(); |
|
342 | 342 | // get the coordinates of drawing |
343 | - $cDrawing = \PhpSpreadsheet\Cell::stringFromColumnIndex($iInc - 1) . $rangeBounds[0][1]; |
|
343 | + $cDrawing = \PhpSpreadsheet\Cell::stringFromColumnIndex($iInc - 1) . $rangeBounds[0][1]; |
|
344 | 344 | $oDrawing->setCoordinates($cDrawing); |
345 | 345 | $oDrawing->setWorksheet($sheet); |
346 | 346 | |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | $dataProp .= pack('v', 0x000A); |
623 | 623 | $dataProp .= pack('v', 0x0000); |
624 | 624 | // value |
625 | - $dataProp .= 'Worksheet'.chr(0); |
|
625 | + $dataProp .= 'Worksheet' . chr(0); |
|
626 | 626 | |
627 | 627 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D), |
628 | 628 | 'offset' => array('pack' => 'V'), |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | $dataProp['data']['data'] .= chr(0); |
697 | 697 | $dataProp['data']['length'] += 1; |
698 | 698 | // Complete the string with null string for being a %4 |
699 | - $dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4)==4 ? 0 : (4 - $dataProp['data']['length'] % 4)); |
|
699 | + $dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4) == 4 ? 0 : (4 - $dataProp['data']['length'] % 4)); |
|
700 | 700 | $dataProp['data']['data'] = str_pad($dataProp['data']['data'], $dataProp['data']['length'], chr(0), STR_PAD_RIGHT); |
701 | 701 | |
702 | 702 | $dataSection_Content .= pack('V', $dataProp['data']['length']); |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | $dataProp['data']['data'] .= chr(0); |
873 | 873 | $dataProp['data']['length'] += 1; |
874 | 874 | // Complete the string with null string for being a %4 |
875 | - $dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4)==4 ? 0 : (4 - $dataProp['data']['length'] % 4)); |
|
875 | + $dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4) == 4 ? 0 : (4 - $dataProp['data']['length'] % 4)); |
|
876 | 876 | $dataProp['data']['data'] = str_pad($dataProp['data']['data'], $dataProp['data']['length'], chr(0), STR_PAD_RIGHT); |
877 | 877 | |
878 | 878 | $dataSection_Content .= pack('V', $dataProp['data']['length']); |
@@ -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); |
@@ -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 | } |