Apply Scrutinizer patches for indentation

This commit is contained in:
Adrien Crivelli 2016-08-25 19:35:29 +09:00
parent a85f1bdbed
commit cb0930c016
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
13 changed files with 225 additions and 191 deletions

View File

@ -232,7 +232,7 @@ class Calculation
'NULL' => null,
];
// PhpSpreadsheet functions
// PhpSpreadsheet functions
private static $phpSpreadsheetFunctions = [
'ABS' => [
'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG,
@ -3073,13 +3073,13 @@ class Calculation
$pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null;
$regexpMatchString = '/^(' . self::CALCULATION_REGEXP_FUNCTION .
'|' . self::CALCULATION_REGEXP_CELLREF .
'|' . self::CALCULATION_REGEXP_NUMBER .
'|' . self::CALCULATION_REGEXP_STRING .
'|' . self::CALCULATION_REGEXP_OPENBRACE .
'|' . self::CALCULATION_REGEXP_NAMEDRANGE .
'|' . self::CALCULATION_REGEXP_ERROR .
')/si';
'|' . self::CALCULATION_REGEXP_CELLREF .
'|' . self::CALCULATION_REGEXP_NUMBER .
'|' . self::CALCULATION_REGEXP_STRING .
'|' . self::CALCULATION_REGEXP_OPENBRACE .
'|' . self::CALCULATION_REGEXP_NAMEDRANGE .
'|' . self::CALCULATION_REGEXP_ERROR .
')/si';
// Start with initialisation
$index = 0;

View File

@ -497,7 +497,7 @@ class FormulaParser
(($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
(($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)
)) {
)) {
continue;
}
@ -509,7 +509,7 @@ class FormulaParser
(($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) && ($nextToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_START)) ||
(($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($nextToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_START)) ||
($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)
)) {
)) {
continue;
}

View File

@ -845,11 +845,11 @@ class Cell
$_indexCache[$pColumnIndex] = chr(65 + $pColumnIndex);
} elseif ($pColumnIndex < 702) {
$_indexCache[$pColumnIndex] = chr(64 + ($pColumnIndex / 26)) .
chr(65 + $pColumnIndex % 26);
chr(65 + $pColumnIndex % 26);
} else {
$_indexCache[$pColumnIndex] = chr(64 + (($pColumnIndex - 26) / 676)) .
chr(65 + ((($pColumnIndex - 26) % 676) / 26)) .
chr(65 + $pColumnIndex % 26);
chr(65 + ((($pColumnIndex - 26) % 676) / 26)) .
chr(65 + $pColumnIndex % 26);
}
}

View File

@ -76,7 +76,7 @@ class GridLines extends Properties
private $softEdges = [
'size' => null,
];
];
/**
* Get Object State

View File

@ -253,9 +253,10 @@ class CSV extends BaseReader implements IReader
}
$sheet = $spreadsheet->setActiveSheetIndex($this->sheetIndex);
$escapeEnclosures = ['\\' . $this->enclosure,
$this->enclosure . $this->enclosure,
];
$escapeEnclosures = [
'\\' . $this->enclosure,
$this->enclosure . $this->enclosure,
];
// Set our starting row based on whether we're in contiguous mode or not
$currentRow = 1;

View File

@ -446,7 +446,7 @@ class ReferenceHelper
if ($cell->getDataType() == Cell\DataType::TYPE_FORMULA) {
// Formula should be adjusted
$pSheet->getCell($newCoordinates)
->setValue($this->updateFormulaReferences($cell->getValue(), $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle()));
->setValue($this->updateFormulaReferences($cell->getValue(), $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle()));
} else {
// Formula should not be adjusted
$pSheet->getCell($newCoordinates)->setValue($cell->getValue());

View File

@ -143,40 +143,40 @@ class Font
*/
public static $defaultColumnWidths = [
'Arial' => [
1 => ['px' => 24, 'width' => 12.00000000],
2 => ['px' => 24, 'width' => 12.00000000],
3 => ['px' => 32, 'width' => 10.66406250],
4 => ['px' => 32, 'width' => 10.66406250],
5 => ['px' => 40, 'width' => 10.00000000],
6 => ['px' => 48, 'width' => 9.59765625],
7 => ['px' => 48, 'width' => 9.59765625],
8 => ['px' => 56, 'width' => 9.33203125],
9 => ['px' => 64, 'width' => 9.14062500],
1 => ['px' => 24, 'width' => 12.00000000],
2 => ['px' => 24, 'width' => 12.00000000],
3 => ['px' => 32, 'width' => 10.66406250],
4 => ['px' => 32, 'width' => 10.66406250],
5 => ['px' => 40, 'width' => 10.00000000],
6 => ['px' => 48, 'width' => 9.59765625],
7 => ['px' => 48, 'width' => 9.59765625],
8 => ['px' => 56, 'width' => 9.33203125],
9 => ['px' => 64, 'width' => 9.14062500],
10 => ['px' => 64, 'width' => 9.14062500],
],
'Calibri' => [
1 => ['px' => 24, 'width' => 12.00000000],
2 => ['px' => 24, 'width' => 12.00000000],
3 => ['px' => 32, 'width' => 10.66406250],
4 => ['px' => 32, 'width' => 10.66406250],
5 => ['px' => 40, 'width' => 10.00000000],
6 => ['px' => 48, 'width' => 9.59765625],
7 => ['px' => 48, 'width' => 9.59765625],
8 => ['px' => 56, 'width' => 9.33203125],
9 => ['px' => 56, 'width' => 9.33203125],
1 => ['px' => 24, 'width' => 12.00000000],
2 => ['px' => 24, 'width' => 12.00000000],
3 => ['px' => 32, 'width' => 10.66406250],
4 => ['px' => 32, 'width' => 10.66406250],
5 => ['px' => 40, 'width' => 10.00000000],
6 => ['px' => 48, 'width' => 9.59765625],
7 => ['px' => 48, 'width' => 9.59765625],
8 => ['px' => 56, 'width' => 9.33203125],
9 => ['px' => 56, 'width' => 9.33203125],
10 => ['px' => 64, 'width' => 9.14062500],
11 => ['px' => 64, 'width' => 9.14062500],
],
'Verdana' => [
1 => ['px' => 24, 'width' => 12.00000000],
2 => ['px' => 24, 'width' => 12.00000000],
3 => ['px' => 32, 'width' => 10.66406250],
4 => ['px' => 32, 'width' => 10.66406250],
5 => ['px' => 40, 'width' => 10.00000000],
6 => ['px' => 48, 'width' => 9.59765625],
7 => ['px' => 48, 'width' => 9.59765625],
8 => ['px' => 64, 'width' => 9.14062500],
9 => ['px' => 72, 'width' => 9.00000000],
1 => ['px' => 24, 'width' => 12.00000000],
2 => ['px' => 24, 'width' => 12.00000000],
3 => ['px' => 32, 'width' => 10.66406250],
4 => ['px' => 32, 'width' => 10.66406250],
5 => ['px' => 40, 'width' => 10.00000000],
6 => ['px' => 48, 'width' => 9.59765625],
7 => ['px' => 48, 'width' => 9.59765625],
8 => ['px' => 64, 'width' => 9.14062500],
9 => ['px' => 72, 'width' => 9.00000000],
10 => ['px' => 72, 'width' => 9.00000000],
],
];

View File

@ -541,12 +541,12 @@ class PclZip
// ----- For each file in the list check the attributes
$v_supported_attributes = [
PCLZIP_ATT_FILE_NAME => 'mandatory',
PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional',
PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional',
PCLZIP_ATT_FILE_MTIME => 'optional',
PCLZIP_ATT_FILE_CONTENT => 'optional',
PCLZIP_ATT_FILE_COMMENT => 'optional',
PCLZIP_ATT_FILE_NAME => 'mandatory',
PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional',
PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional',
PCLZIP_ATT_FILE_MTIME => 'optional',
PCLZIP_ATT_FILE_CONTENT => 'optional',
PCLZIP_ATT_FILE_COMMENT => 'optional',
];
foreach ($v_att_list as $v_entry) {
$v_result = $this->privFileDescrParseAtt($v_entry, $v_filedescr_list[], $v_options, $v_supported_attributes);
@ -704,25 +704,25 @@ class PclZip
if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
// ----- Parse the options
$v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, [
PCLZIP_OPT_PATH => 'optional',
PCLZIP_OPT_REMOVE_PATH => 'optional',
PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
PCLZIP_OPT_ADD_PATH => 'optional',
PCLZIP_CB_PRE_EXTRACT => 'optional',
PCLZIP_CB_POST_EXTRACT => 'optional',
PCLZIP_OPT_SET_CHMOD => 'optional',
PCLZIP_OPT_BY_NAME => 'optional',
PCLZIP_OPT_BY_EREG => 'optional',
PCLZIP_OPT_BY_PREG => 'optional',
PCLZIP_OPT_BY_INDEX => 'optional',
PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional',
PCLZIP_OPT_REPLACE_NEWER => 'optional',
PCLZIP_OPT_STOP_ON_ERROR => 'optional',
PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',
PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
PCLZIP_OPT_TEMP_FILE_ON => 'optional',
PCLZIP_OPT_TEMP_FILE_OFF => 'optional',
PCLZIP_OPT_PATH => 'optional',
PCLZIP_OPT_REMOVE_PATH => 'optional',
PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
PCLZIP_OPT_ADD_PATH => 'optional',
PCLZIP_CB_PRE_EXTRACT => 'optional',
PCLZIP_CB_POST_EXTRACT => 'optional',
PCLZIP_OPT_SET_CHMOD => 'optional',
PCLZIP_OPT_BY_NAME => 'optional',
PCLZIP_OPT_BY_EREG => 'optional',
PCLZIP_OPT_BY_PREG => 'optional',
PCLZIP_OPT_BY_INDEX => 'optional',
PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional',
PCLZIP_OPT_REPLACE_NEWER => 'optional',
PCLZIP_OPT_STOP_ON_ERROR => 'optional',
PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',
PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
PCLZIP_OPT_TEMP_FILE_ON => 'optional',
PCLZIP_OPT_TEMP_FILE_OFF => 'optional',
]);
if ($v_result != 1) {
return 0;

View File

@ -706,9 +706,10 @@ class AutoFilter
$operator = ($dynamicRuleType === AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE)
? AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN
: AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN;
$ruleValues[] = ['operator' => $operator,
'value' => $average,
];
$ruleValues[] = [
'operator' => $operator,
'value' => $average,
];
$columnFilterTests[$columnID] = [
'method' => 'filterTestInCustomDataSet',
'arguments' => ['filterRules' => $ruleValues, 'join' => AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_OR],

View File

@ -46,11 +46,11 @@ class Comments extends WriterPart
// XML header
$objWriter->startDocument('1.0', 'UTF-8', 'yes');
// Comments cache
$comments = $pWorksheet->getComments();
// Comments cache
$comments = $pWorksheet->getComments();
// Authors cache
$authors = [];
// Authors cache
$authors = [];
$authorId = 0;
foreach ($comments as $comment) {
if (!isset($authors[$comment->getAuthor()])) {
@ -126,8 +126,8 @@ class Comments extends WriterPart
// XML header
$objWriter->startDocument('1.0', 'UTF-8', 'yes');
// Comments cache
$comments = $pWorksheet->getComments();
// Comments cache
$comments = $pWorksheet->getComments();
// xml
$objWriter->startElement('xml');
@ -189,7 +189,7 @@ class Comments extends WriterPart
private function writeVMLComment(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pCellReference = 'A1', \PhpSpreadsheet\Comment $pComment = null)
{
// Metadata
list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($pCellReference);
list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($pCellReference);
$column = \PhpSpreadsheet\Cell::columnIndexFromString($column);
$id = 1024 + $column + $row;
$id = substr($id, 0, 4);

View File

@ -294,8 +294,7 @@ class Excel5 extends BaseWriter implements IWriter
// set the shape index (we combine 1-based sheet index and $countShapes to create unique shape index)
$reducedSpId = $countShapes[$sheetIndex];
$spId = $reducedSpId
| ($sheet->getParent()->getIndex($sheet) + 1) << 10;
$spId = $reducedSpId | ($sheet->getParent()->getIndex($sheet) + 1) << 10;
$spContainer->setSpId($spId);
// keep track of last reducedSpId
@ -352,8 +351,7 @@ class Excel5 extends BaseWriter implements IWriter
// set the shape index (we combine 1-based sheet index and $countShapes to create unique shape index)
$reducedSpId = $countShapes[$sheetIndex];
$spId = $reducedSpId
| ($sheet->getParent()->getIndex($sheet) + 1) << 10;
$spId = $reducedSpId | ($sheet->getParent()->getIndex($sheet) + 1) << 10;
$spContainer->setSpId($spId);
// keep track of last reducedSpId
@ -564,50 +562,64 @@ class Excel5 extends BaseWriter implements IWriter
$dataSection_Content = '';
// GKPIDDSI_CODEPAGE: CodePage
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x01],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x02], // 2 byte signed integer
'data' => ['data' => 1252], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x01],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x02], // 2 byte signed integer
'data' => ['data' => 1252],
];
++$dataSection_NumProps;
// GKPIDDSI_CATEGORY : Category
if ($this->spreadsheet->getProperties()->getCategory()) {
$dataProp = $this->spreadsheet->getProperties()->getCategory();
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x02],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E],
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x02],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E],
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
];
++$dataSection_NumProps;
}
// GKPIDDSI_VERSION :Version of the application that wrote the property storage
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x17],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x03],
'data' => ['pack' => 'V', 'data' => 0x000C0000], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x17],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x03],
'data' => ['pack' => 'V', 'data' => 0x000C0000],
];
++$dataSection_NumProps;
// GKPIDDSI_SCALE : FALSE
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x0B],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x0B],
'data' => ['data' => false], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x0B],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x0B],
'data' => ['data' => false],
];
++$dataSection_NumProps;
// GKPIDDSI_LINKSDIRTY : True if any of the values for the linked properties have changed outside of the application
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x10],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x0B],
'data' => ['data' => false], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x10],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x0B],
'data' => ['data' => false],
];
++$dataSection_NumProps;
// GKPIDDSI_SHAREDOC : FALSE
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x13],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x0B],
'data' => ['data' => false], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x13],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x0B],
'data' => ['data' => false],
];
++$dataSection_NumProps;
// GKPIDDSI_HYPERLINKSCHANGED : True if any of the values for the _PID_LINKS (hyperlink text) have changed outside of the application
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x16],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x0B],
'data' => ['data' => false], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x16],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x0B],
'data' => ['data' => false],
];
++$dataSection_NumProps;
// GKPIDDSI_DOCSPARTS
@ -617,50 +629,54 @@ class Excel5 extends BaseWriter implements IWriter
$dataProp = pack('v', 0x0001);
$dataProp .= pack('v', 0x0000);
// array of UnalignedLpstr
// cch
$dataProp .= pack('v', 0x000A);
// cch
$dataProp .= pack('v', 0x000A);
$dataProp .= pack('v', 0x0000);
// value
$dataProp .= 'Worksheet' . chr(0);
// value
$dataProp .= 'Worksheet' . chr(0);
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x0D],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x101E],
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x0D],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x101E],
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
];
++$dataSection_NumProps;
// GKPIDDSI_HEADINGPAIR
// VtVecHeadingPairValue
// cElements
$dataProp = pack('v', 0x0002);
// cElements
$dataProp = pack('v', 0x0002);
$dataProp .= pack('v', 0x0000);
// Array of vtHeadingPair
// vtUnalignedString - headingString
// stringType
$dataProp .= pack('v', 0x001E);
// padding
$dataProp .= pack('v', 0x0000);
// UnalignedLpstr
// cch
$dataProp .= pack('v', 0x0013);
// Array of vtHeadingPair
// vtUnalignedString - headingString
// stringType
$dataProp .= pack('v', 0x001E);
// padding
$dataProp .= pack('v', 0x0000);
// value
$dataProp .= 'Feuilles de calcul';
// vtUnalignedString - headingParts
// wType : 0x0003 = 32 bit signed integer
$dataProp .= pack('v', 0x0300);
// padding
$dataProp .= pack('v', 0x0000);
// value
$dataProp .= pack('v', 0x0100);
// UnalignedLpstr
// cch
$dataProp .= pack('v', 0x0013);
$dataProp .= pack('v', 0x0000);
// value
$dataProp .= 'Feuilles de calcul';
// vtUnalignedString - headingParts
// wType : 0x0003 = 32 bit signed integer
$dataProp .= pack('v', 0x0300);
// padding
$dataProp .= pack('v', 0x0000);
// value
$dataProp .= pack('v', 0x0100);
$dataProp .= pack('v', 0x0000);
$dataProp .= pack('v', 0x0000);
$dataProp .= pack('v', 0x0000);
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x0C],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x100C],
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x0C],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x100C],
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
];
++$dataSection_NumProps;
// 4 Section Length
@ -760,89 +776,109 @@ class Excel5 extends BaseWriter implements IWriter
$dataSection_Content = '';
// CodePage : CP-1252
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x01],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x02], // 2 byte signed integer
'data' => ['data' => 1252], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x01],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x02], // 2 byte signed integer
'data' => ['data' => 1252],
];
++$dataSection_NumProps;
// Title
if ($this->spreadsheet->getProperties()->getTitle()) {
$dataProp = $this->spreadsheet->getProperties()->getTitle();
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x02],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x02],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
];
++$dataSection_NumProps;
}
// Subject
if ($this->spreadsheet->getProperties()->getSubject()) {
$dataProp = $this->spreadsheet->getProperties()->getSubject();
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x03],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x03],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
];
++$dataSection_NumProps;
}
// Author (Creator)
if ($this->spreadsheet->getProperties()->getCreator()) {
$dataProp = $this->spreadsheet->getProperties()->getCreator();
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x04],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x04],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
];
++$dataSection_NumProps;
}
// Keywords
if ($this->spreadsheet->getProperties()->getKeywords()) {
$dataProp = $this->spreadsheet->getProperties()->getKeywords();
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x05],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x05],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
];
++$dataSection_NumProps;
}
// Comments (Description)
if ($this->spreadsheet->getProperties()->getDescription()) {
$dataProp = $this->spreadsheet->getProperties()->getDescription();
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x06],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x06],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
];
++$dataSection_NumProps;
}
// Last Saved By (LastModifiedBy)
if ($this->spreadsheet->getProperties()->getLastModifiedBy()) {
$dataProp = $this->spreadsheet->getProperties()->getLastModifiedBy();
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x08],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x08],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
];
++$dataSection_NumProps;
}
// Created Date/Time
if ($this->spreadsheet->getProperties()->getCreated()) {
$dataProp = $this->spreadsheet->getProperties()->getCreated();
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x0C],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x40], // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
'data' => ['data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp)], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x0C],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x40], // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
'data' => ['data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp)],
];
++$dataSection_NumProps;
}
// Modified Date/Time
if ($this->spreadsheet->getProperties()->getModified()) {
$dataProp = $this->spreadsheet->getProperties()->getModified();
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x0D],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x40], // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
'data' => ['data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp)], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x0D],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x40], // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
'data' => ['data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp)],
];
++$dataSection_NumProps;
}
// Security
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x13],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x03], // 4 byte signed integer
'data' => ['data' => 0x00], ];
$dataSection[] = [
'summary' => ['pack' => 'V', 'data' => 0x13],
'offset' => ['pack' => 'V'],
'type' => ['pack' => 'V', 'data' => 0x03], // 4 byte signed integer
'data' => ['data' => 0x00],
];
++$dataSection_NumProps;
// 4 Section Length

View File

@ -666,7 +666,7 @@ class Parser
list($row1, $col1) = $this->cellToPackedRowcol($cell1);
list($row2, $col2) = $this->cellToPackedRowcol($cell2);
} else { // It's a rows range (like 26:27)
list($row1, $col1, $row2, $col2) = $this->rangeToPackedRange($cell1 . ':' . $cell2);
list($row1, $col1, $row2, $col2) = $this->rangeToPackedRange($cell1 . ':' . $cell2);
}
// The ptg value depends on the class of the ptg.

View File

@ -1019,9 +1019,7 @@ class Worksheet extends BIFFwriter
$data = pack('vvvv', $row1, $row2, $col1, $col2);
// Write the packed data
$this->append($header . $data .
$unknown1 . $options .
$unknown2 . $url_len . $url);
$this->append($header . $data . $unknown1 . $options . $unknown2 . $url_len . $url);
return 0;
}
@ -1068,9 +1066,7 @@ class Worksheet extends BIFFwriter
$data = pack('vvvv', $row1, $row2, $col1, $col2);
// Write the packed data
$this->append($header . $data .
$unknown1 . $options .
$url_len . $url);
$this->append($header . $data . $unknown1 . $options . $url_len . $url);
return 0;
}