|
@@ -1919,7 +1919,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
}
|
|
|
|
|
|
// offset: 10; size: 1; underline type
|
|
|
- $underlineType = ord($recordData{10});
|
|
|
+ $underlineType = ord($recordData[10]);
|
|
|
switch ($underlineType) {
|
|
|
case 0x00:
|
|
|
break; // no underline
|
|
@@ -2058,7 +2058,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
|
|
|
// offset: 6; size: 1; Alignment and text break
|
|
|
// bit 2-0, mask 0x07; horizontal alignment
|
|
|
- $horAlign = (0x07 & ord($recordData{6})) >> 0;
|
|
|
+ $horAlign = (0x07 & ord($recordData[6])) >> 0;
|
|
|
switch ($horAlign) {
|
|
|
case 0:
|
|
|
$objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_GENERAL);
|
|
@@ -2083,7 +2083,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
break;
|
|
|
}
|
|
|
// bit 3, mask 0x08; wrap text
|
|
|
- $wrapText = (0x08 & ord($recordData{6})) >> 3;
|
|
|
+ $wrapText = (0x08 & ord($recordData[6])) >> 3;
|
|
|
switch ($wrapText) {
|
|
|
case 0:
|
|
|
$objStyle->getAlignment()->setWrapText(false);
|
|
@@ -2093,7 +2093,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
break;
|
|
|
}
|
|
|
// bit 6-4, mask 0x70; vertical alignment
|
|
|
- $vertAlign = (0x70 & ord($recordData{6})) >> 4;
|
|
|
+ $vertAlign = (0x70 & ord($recordData[6])) >> 4;
|
|
|
switch ($vertAlign) {
|
|
|
case 0:
|
|
|
$objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);
|
|
@@ -2111,7 +2111,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
|
|
|
if ($this->_version == self::XLS_BIFF8) {
|
|
|
// offset: 7; size: 1; XF_ROTATION: Text rotation angle
|
|
|
- $angle = ord($recordData{7});
|
|
|
+ $angle = ord($recordData[7]);
|
|
|
$rotation = 0;
|
|
|
if ($angle <= 90) {
|
|
|
$rotation = $angle;
|
|
@@ -2124,11 +2124,11 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
|
|
|
// offset: 8; size: 1; Indentation, shrink to cell size, and text direction
|
|
|
// bit: 3-0; mask: 0x0F; indent level
|
|
|
- $indent = (0x0F & ord($recordData{8})) >> 0;
|
|
|
+ $indent = (0x0F & ord($recordData[8])) >> 0;
|
|
|
$objStyle->getAlignment()->setIndent($indent);
|
|
|
|
|
|
// bit: 4; mask: 0x10; 1 = shrink content to fit into cell
|
|
|
- $shrinkToFit = (0x10 & ord($recordData{8})) >> 4;
|
|
|
+ $shrinkToFit = (0x10 & ord($recordData[8])) >> 4;
|
|
|
switch ($shrinkToFit) {
|
|
|
case 0:
|
|
|
$objStyle->getAlignment()->setShrinkToFit(false);
|
|
@@ -2210,7 +2210,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
// BIFF5
|
|
|
|
|
|
// offset: 7; size: 1; Text orientation and flags
|
|
|
- $orientationAndFlags = ord($recordData{7});
|
|
|
+ $orientationAndFlags = ord($recordData[7]);
|
|
|
|
|
|
// bit: 1-0; mask: 0x03; XF_ORIENTATION: Text orientation
|
|
|
$xfOrientation = (0x03 & $orientationAndFlags) >> 0;
|
|
@@ -2334,7 +2334,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
|
|
|
|
|
|
if ($xclfType == 2) {
|
|
|
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue{1}), ord($xclrValue{2}));
|
|
|
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
|
|
|
|
|
|
// modify the relevant style property
|
|
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
|
|
@@ -2350,7 +2350,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
|
|
|
|
|
|
if ($xclfType == 2) {
|
|
|
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue{1}), ord($xclrValue{2}));
|
|
|
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
|
|
|
|
|
|
// modify the relevant style property
|
|
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
|
|
@@ -2366,7 +2366,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
|
|
|
|
|
|
if ($xclfType == 2) {
|
|
|
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue{1}), ord($xclrValue{2}));
|
|
|
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
|
|
|
|
|
|
// modify the relevant style property
|
|
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
|
|
@@ -2382,7 +2382,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
|
|
|
|
|
|
if ($xclfType == 2) {
|
|
|
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue{1}), ord($xclrValue{2}));
|
|
|
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
|
|
|
|
|
|
// modify the relevant style property
|
|
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
|
|
@@ -2398,7 +2398,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
|
|
|
|
|
|
if ($xclfType == 2) {
|
|
|
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue{1}), ord($xclrValue{2}));
|
|
|
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
|
|
|
|
|
|
// modify the relevant style property
|
|
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
|
|
@@ -2414,7 +2414,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
|
|
|
|
|
|
if ($xclfType == 2) {
|
|
|
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue{1}), ord($xclrValue{2}));
|
|
|
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
|
|
|
|
|
|
// modify the relevant style property
|
|
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
|
|
@@ -2430,7 +2430,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
|
|
|
|
|
|
if ($xclfType == 2) {
|
|
|
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue{1}), ord($xclrValue{2}));
|
|
|
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
|
|
|
|
|
|
// modify the relevant style property
|
|
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
|
|
@@ -2446,7 +2446,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
|
|
|
|
|
|
if ($xclfType == 2) {
|
|
|
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue{1}), ord($xclrValue{2}));
|
|
|
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
|
|
|
|
|
|
// modify the relevant style property
|
|
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
|
|
@@ -2488,7 +2488,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
|
|
|
if ($isBuiltIn) {
|
|
|
// offset: 2; size: 1; identifier for built-in style
|
|
|
- $builtInId = ord($recordData{2});
|
|
|
+ $builtInId = ord($recordData[2]);
|
|
|
|
|
|
switch ($builtInId) {
|
|
|
case 0x00:
|
|
@@ -2555,7 +2555,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$this->_pos += 4 + $length;
|
|
|
|
|
|
// offset: 4; size: 1; sheet state
|
|
|
- switch (ord($recordData{4})) {
|
|
|
+ switch (ord($recordData[4])) {
|
|
|
case 0x00: $sheetState = PHPExcel_Worksheet::SHEETSTATE_VISIBLE; break;
|
|
|
case 0x01: $sheetState = PHPExcel_Worksheet::SHEETSTATE_HIDDEN; break;
|
|
|
case 0x02: $sheetState = PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN; break;
|
|
@@ -2563,7 +2563,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
}
|
|
|
|
|
|
// offset: 5; size: 1; sheet type
|
|
|
- $sheetType = ord($recordData{5});
|
|
|
+ $sheetType = ord($recordData[5]);
|
|
|
|
|
|
// offset: 6; size: var; sheet name
|
|
|
if ($this->_version == self::XLS_BIFF8) {
|
|
@@ -2742,7 +2742,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
// offset: 2; size: 1; keyboard shortcut
|
|
|
|
|
|
// offset: 3; size: 1; length of the name (character count)
|
|
|
- $nlen = ord($recordData{3});
|
|
|
+ $nlen = ord($recordData[3]);
|
|
|
|
|
|
// offset: 4; size: 2; size of the formula data (it can happen that this is zero)
|
|
|
// note: there can also be additional data, this is not included in $flen
|
|
@@ -2826,7 +2826,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$pos += 2;
|
|
|
|
|
|
// option flags
|
|
|
- $optionFlags = ord($recordData{$pos});
|
|
|
+ $optionFlags = ord($recordData[$pos]);
|
|
|
++$pos;
|
|
|
|
|
|
// bit: 0; mask: 0x01; 0 = compressed; 1 = uncompressed
|
|
@@ -2895,7 +2895,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
|
|
|
// repeated option flags
|
|
|
// OpenOffice.org documentation 5.21
|
|
|
- $option = ord($recordData{$pos});
|
|
|
+ $option = ord($recordData[$pos]);
|
|
|
++$pos;
|
|
|
|
|
|
if ($isCompressed && ($option == 0)) {
|
|
@@ -2919,7 +2919,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
// this fragment compressed
|
|
|
$len = min($charsLeft, $limitpos - $pos);
|
|
|
for ($j = 0; $j < $len; ++$j) {
|
|
|
- $retstr .= $recordData{$pos + $j} . chr(0);
|
|
|
+ $retstr .= $recordData[$pos + $j] . chr(0);
|
|
|
}
|
|
|
$charsLeft -= $len;
|
|
|
$isCompressed = false;
|
|
@@ -3818,7 +3818,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
// We can apparently not rely on $isPartOfSharedFormula. Even when $isPartOfSharedFormula = true
|
|
|
// the formula data may be ordinary formula data, therefore we need to check
|
|
|
// explicitly for the tExp token (0x01)
|
|
|
- $isPartOfSharedFormula = $isPartOfSharedFormula && ord($formulaStructure{2}) == 0x01;
|
|
|
+ $isPartOfSharedFormula = $isPartOfSharedFormula && ord($formulaStructure[2]) == 0x01;
|
|
|
|
|
|
if ($isPartOfSharedFormula) {
|
|
|
// part of shared formula which means there will be a formula with a tExp token and nothing else
|
|
@@ -3842,9 +3842,9 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$xfIndex = self::_GetInt2d($recordData, 4);
|
|
|
|
|
|
// offset: 6; size: 8; result of the formula
|
|
|
- if ( (ord($recordData{6}) == 0)
|
|
|
- && (ord($recordData{12}) == 255)
|
|
|
- && (ord($recordData{13}) == 255) ) {
|
|
|
+ if ( (ord($recordData[6]) == 0)
|
|
|
+ && (ord($recordData[12]) == 255)
|
|
|
+ && (ord($recordData[13]) == 255) ) {
|
|
|
|
|
|
// String formula. Result follows in appended STRING record
|
|
|
$dataType = PHPExcel_Cell_DataType::TYPE_STRING;
|
|
@@ -3858,25 +3858,25 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
// read STRING record
|
|
|
$value = $this->_readString();
|
|
|
|
|
|
- } elseif ((ord($recordData{6}) == 1)
|
|
|
- && (ord($recordData{12}) == 255)
|
|
|
- && (ord($recordData{13}) == 255)) {
|
|
|
+ } elseif ((ord($recordData[6]) == 1)
|
|
|
+ && (ord($recordData[12]) == 255)
|
|
|
+ && (ord($recordData[13]) == 255)) {
|
|
|
|
|
|
// Boolean formula. Result is in +2; 0=false, 1=true
|
|
|
$dataType = PHPExcel_Cell_DataType::TYPE_BOOL;
|
|
|
- $value = (bool) ord($recordData{8});
|
|
|
+ $value = (bool) ord($recordData[8]);
|
|
|
|
|
|
- } elseif ((ord($recordData{6}) == 2)
|
|
|
- && (ord($recordData{12}) == 255)
|
|
|
- && (ord($recordData{13}) == 255)) {
|
|
|
+ } elseif ((ord($recordData[6]) == 2)
|
|
|
+ && (ord($recordData[12]) == 255)
|
|
|
+ && (ord($recordData[13]) == 255)) {
|
|
|
|
|
|
// Error formula. Error code is in +2
|
|
|
$dataType = PHPExcel_Cell_DataType::TYPE_ERROR;
|
|
|
- $value = self::_mapErrorCode(ord($recordData{8}));
|
|
|
+ $value = self::_mapErrorCode(ord($recordData[8]));
|
|
|
|
|
|
- } elseif ((ord($recordData{6}) == 3)
|
|
|
- && (ord($recordData{12}) == 255)
|
|
|
- && (ord($recordData{13}) == 255)) {
|
|
|
+ } elseif ((ord($recordData[6]) == 3)
|
|
|
+ && (ord($recordData[12]) == 255)
|
|
|
+ && (ord($recordData[13]) == 255)) {
|
|
|
|
|
|
// Formula result is a null string
|
|
|
$dataType = PHPExcel_Cell_DataType::TYPE_NULL;
|
|
@@ -3944,7 +3944,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
// offset: 6, size: 1; not used
|
|
|
|
|
|
// offset: 7, size: 1; number of existing FORMULA records for this shared formula
|
|
|
- $no = ord($recordData{7});
|
|
|
+ $no = ord($recordData[7]);
|
|
|
|
|
|
// offset: 8, size: var; Binary token array of the shared formula
|
|
|
$formula = substr($recordData, 8);
|
|
@@ -4011,10 +4011,10 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$xfIndex = self::_GetInt2d($recordData, 4);
|
|
|
|
|
|
// offset: 6; size: 1; the boolean value or error value
|
|
|
- $boolErr = ord($recordData{6});
|
|
|
+ $boolErr = ord($recordData[6]);
|
|
|
|
|
|
// offset: 7; size: 1; 0=boolean; 1=error
|
|
|
- $isError = ord($recordData{7});
|
|
|
+ $isError = ord($recordData[7]);
|
|
|
|
|
|
$cell = $this->_phpSheet->getCell($columnString . ($row + 1));
|
|
|
switch ($isError) {
|
|
@@ -4412,17 +4412,17 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
|
|
|
// first row '1' + last row '16384' indicates that full column is selected (apparently also in BIFF8!)
|
|
|
if (preg_match('/^([A-Z]+1\:[A-Z]+)16384$/', $selectedCells)) {
|
|
|
- $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)16384$/', '${1}1048576', $selectedCells);
|
|
|
+ $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)16384$/', '$[1]1048576', $selectedCells);
|
|
|
}
|
|
|
|
|
|
// first row '1' + last row '65536' indicates that full column is selected
|
|
|
if (preg_match('/^([A-Z]+1\:[A-Z]+)65536$/', $selectedCells)) {
|
|
|
- $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)65536$/', '${1}1048576', $selectedCells);
|
|
|
+ $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)65536$/', '$[1]1048576', $selectedCells);
|
|
|
}
|
|
|
|
|
|
// first column 'A' + last column 'IV' indicates that full row is selected
|
|
|
if (preg_match('/^(A[0-9]+\:)IV([0-9]+)$/', $selectedCells)) {
|
|
|
- $selectedCells = preg_replace('/^(A[0-9]+\:)IV([0-9]+)$/', '${1}XFD${2}', $selectedCells);
|
|
|
+ $selectedCells = preg_replace('/^(A[0-9]+\:)IV([0-9]+)$/', '$[1]XFD$[2]', $selectedCells);
|
|
|
}
|
|
|
|
|
|
$this->_phpSheet->setSelectedCells($selectedCells);
|
|
@@ -4544,9 +4544,9 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$hyperlinkType = 'UNC';
|
|
|
} else if (!$isFileLinkOrUrl) {
|
|
|
$hyperlinkType = 'workbook';
|
|
|
- } else if (ord($recordData{$offset}) == 0x03) {
|
|
|
+ } else if (ord($recordData[$offset]) == 0x03) {
|
|
|
$hyperlinkType = 'local';
|
|
|
- } else if (ord($recordData{$offset}) == 0xE0) {
|
|
|
+ } else if (ord($recordData[$offset]) == 0xE0) {
|
|
|
$hyperlinkType = 'URL';
|
|
|
}
|
|
|
|
|
@@ -6094,10 +6094,10 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$lr = self::_GetInt2d($subData, 2) + 1;
|
|
|
|
|
|
// offset: 4; size: 1; index to first column
|
|
|
- $fc = ord($subData{4});
|
|
|
+ $fc = ord($subData[4]);
|
|
|
|
|
|
// offset: 5; size: 1; index to last column
|
|
|
- $lc = ord($subData{5});
|
|
|
+ $lc = ord($subData[5]);
|
|
|
|
|
|
// check values
|
|
|
if ($fr > $lr || $fc > $lc) {
|
|
@@ -6507,10 +6507,10 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
|
|
|
$r = ord($rgb[0]);
|
|
|
|
|
|
// offset: 1; size: 1; Green component
|
|
|
- $g = ord($rgb{1});
|
|
|
+ $g = ord($rgb[1]);
|
|
|
|
|
|
// offset: 2; size: 1; Blue component
|
|
|
- $b = ord($rgb{2});
|
|
|
+ $b = ord($rgb[2]);
|
|
|
|
|
|
// HEX notation, e.g. 'FF00FC'
|
|
|
$rgb = sprintf('%02X%02X%02X', $r, $g, $b);
|