diff --git a/Classes/PHPExcel/Reader/Excel5.php b/Classes/PHPExcel/Reader/Excel5.php index f327ec0..9461bfd 100644 --- a/Classes/PHPExcel/Reader/Excel5.php +++ b/Classes/PHPExcel/Reader/Excel5.php @@ -540,7 +540,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // Parse Workbook Global Substream while ($this->_pos < $this->_dataSize) { - $code = $this->_GetInt2d($this->_data, $this->_pos); + $code = self::_GetInt2d($this->_data, $this->_pos); switch ($code) { case self::XLS_Type_BOF: $this->_readBof(); break; @@ -670,7 +670,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $this->_sharedFormulas = array(); while ($this->_pos <= $this->_dataSize - 4) { - $code = $this->_GetInt2d($this->_data, $this->_pos); + $code = self::_GetInt2d($this->_data, $this->_pos); switch ($code) { case self::XLS_Type_BOF: $this->_readBof(); break; @@ -794,16 +794,15 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $drawing->setOffsetY($offsetY); switch ($blipType) { + case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG: + $drawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG); + $drawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_JPEG); + break; - case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG: - $drawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG); - $drawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_JPEG); - break; - - case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG: - $drawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_PNG); - $drawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_PNG); - break; + case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG: + $drawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_PNG); + $drawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_PNG); + break; } $drawing->setWorksheet($this->_phpSheet); @@ -967,18 +966,18 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 6; size: 2; OS indicator // offset: 8; size: 16 // offset: 24; size: 4; section count - $secCount = $this->_GetInt4d($this->_summaryInformation, 24); + $secCount = self::_GetInt4d($this->_summaryInformation, 24); // offset: 28; size: 16; first section's class id: e0 85 9f f2 f9 4f 68 10 ab 91 08 00 2b 27 b3 d9 // offset: 44; size: 4 - $secOffset = $this->_GetInt4d($this->_summaryInformation, 44); + $secOffset = self::_GetInt4d($this->_summaryInformation, 44); // section header // offset: $secOffset; size: 4; section length - $secLength = $this->_GetInt4d($this->_summaryInformation, $secOffset); + $secLength = self::_GetInt4d($this->_summaryInformation, $secOffset); // offset: $secOffset+4; size: 4; property count - $countProperties = $this->_GetInt4d($this->_summaryInformation, $secOffset+4); + $countProperties = self::_GetInt4d($this->_summaryInformation, $secOffset+4); // initialize code page (used to resolve string values) $codePage = 'CP1252'; @@ -988,13 +987,13 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader for ($i = 0; $i < $countProperties; ++$i) { // offset: ($secOffset+8) + (8 * $i); size: 4; property ID - $id = $this->_GetInt4d($this->_summaryInformation, ($secOffset+8) + (8 * $i)); + $id = self::_GetInt4d($this->_summaryInformation, ($secOffset+8) + (8 * $i)); // Use value of property id as appropriate // offset: ($secOffset+12) + (8 * $i); size: 4; offset from beginning of section (48) - $offset = $this->_GetInt4d($this->_summaryInformation, ($secOffset+12) + (8 * $i)); + $offset = self::_GetInt4d($this->_summaryInformation, ($secOffset+12) + (8 * $i)); - $type = $this->_GetInt4d($this->_summaryInformation, $secOffset + $offset); + $type = self::_GetInt4d($this->_summaryInformation, $secOffset + $offset); // initialize property value $value = null; @@ -1002,11 +1001,11 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // extract property value based on property type switch ($type) { case 0x02: // 2 byte signed integer - $value = $this->_GetInt2d($this->_summaryInformation, $secOffset + 4 + $offset); + $value = self::_GetInt2d($this->_summaryInformation, $secOffset + 4 + $offset); break; case 0x03: // 4 byte signed integer - $value = $this->_GetInt4d($this->_summaryInformation, $secOffset + 4 + $offset); + $value = self::_GetInt4d($this->_summaryInformation, $secOffset + 4 + $offset); break; case 0x13: // 4 byte unsigned integer @@ -1014,7 +1013,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; case 0x1E: // null-terminated string prepended by dword string length - $byteLength = $this->_GetInt4d($this->_summaryInformation, $secOffset + 4 + $offset); + $byteLength = self::_GetInt4d($this->_summaryInformation, $secOffset + 4 + $offset); $value = substr($this->_summaryInformation, $secOffset + 8 + $offset, $byteLength); $value = PHPExcel_Shared_String::ConvertEncoding($value, 'UTF-8', $codePage); $value = rtrim($value); @@ -1128,21 +1127,21 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 6; size: 2; OS indicator // offset: 8; size: 16 // offset: 24; size: 4; section count - $secCount = $this->_GetInt4d($this->_documentSummaryInformation, 24); + $secCount = self::_GetInt4d($this->_documentSummaryInformation, 24); // echo '$secCount = ',$secCount,'
'; // offset: 28; size: 16; first section's class id: 02 d5 cd d5 9c 2e 1b 10 93 97 08 00 2b 2c f9 ae // offset: 44; size: 4; first section offset - $secOffset = $this->_GetInt4d($this->_documentSummaryInformation, 44); + $secOffset = self::_GetInt4d($this->_documentSummaryInformation, 44); // echo '$secOffset = ',$secOffset,'
'; // section header // offset: $secOffset; size: 4; section length - $secLength = $this->_GetInt4d($this->_documentSummaryInformation, $secOffset); + $secLength = self::_GetInt4d($this->_documentSummaryInformation, $secOffset); // echo '$secLength = ',$secLength,'
'; // offset: $secOffset+4; size: 4; property count - $countProperties = $this->_GetInt4d($this->_documentSummaryInformation, $secOffset+4); + $countProperties = self::_GetInt4d($this->_documentSummaryInformation, $secOffset+4); // echo '$countProperties = ',$countProperties,'
'; // initialize code page (used to resolve string values) @@ -1153,14 +1152,14 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader for ($i = 0; $i < $countProperties; ++$i) { // echo 'Property ',$i,'
'; // offset: ($secOffset+8) + (8 * $i); size: 4; property ID - $id = $this->_GetInt4d($this->_documentSummaryInformation, ($secOffset+8) + (8 * $i)); + $id = self::_GetInt4d($this->_documentSummaryInformation, ($secOffset+8) + (8 * $i)); // echo 'ID is ',$id,'
'; // Use value of property id as appropriate // offset: 60 + 8 * $i; size: 4; offset from beginning of section (48) - $offset = $this->_GetInt4d($this->_documentSummaryInformation, ($secOffset+12) + (8 * $i)); + $offset = self::_GetInt4d($this->_documentSummaryInformation, ($secOffset+12) + (8 * $i)); - $type = $this->_GetInt4d($this->_documentSummaryInformation, $secOffset + $offset); + $type = self::_GetInt4d($this->_documentSummaryInformation, $secOffset + $offset); // echo 'Type is ',$type,', '; // initialize property value @@ -1169,11 +1168,11 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // extract property value based on property type switch ($type) { case 0x02: // 2 byte signed integer - $value = $this->_GetInt2d($this->_documentSummaryInformation, $secOffset + 4 + $offset); + $value = self::_GetInt2d($this->_documentSummaryInformation, $secOffset + 4 + $offset); break; case 0x03: // 4 byte signed integer - $value = $this->_GetInt4d($this->_documentSummaryInformation, $secOffset + 4 + $offset); + $value = self::_GetInt4d($this->_documentSummaryInformation, $secOffset + 4 + $offset); break; case 0x13: // 4 byte unsigned integer @@ -1181,7 +1180,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; case 0x1E: // null-terminated string prepended by dword string length - $byteLength = $this->_GetInt4d($this->_documentSummaryInformation, $secOffset + 4 + $offset); + $byteLength = self::_GetInt4d($this->_documentSummaryInformation, $secOffset + 4 + $offset); $value = substr($this->_documentSummaryInformation, $secOffset + 8 + $offset, $byteLength); $value = PHPExcel_Shared_String::ConvertEncoding($value, 'UTF-8', $codePage); $value = rtrim($value); @@ -1271,7 +1270,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readDefault() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); // $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -1283,18 +1282,18 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readBof() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 2; size: 2; type of the following data - $substreamType = $this->_GetInt2d($recordData, 2); + $substreamType = self::_GetInt2d($recordData, 2); switch ($substreamType) { case self::XLS_WorkbookGlobals: - $version = $this->_GetInt2d($recordData, 0); + $version = self::_GetInt2d($recordData, 0); if (($version != self::XLS_BIFF8) && ($version != self::XLS_BIFF7)) { throw new Exception('Cannot read this Excel file. Version is too old.'); } @@ -1310,7 +1309,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // substream, e.g. chart // just skip the entire substream do { - $code = $this->_GetInt2d($this->_data, $this->_pos); + $code = self::_GetInt2d($this->_data, $this->_pos); $this->_readDefault(); } while ($code != self::XLS_Type_EOF && $this->_pos < $this->_dataSize); break; @@ -1330,7 +1329,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readFilepass() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); // $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -1350,14 +1349,14 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readCodepage() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; code page identifier - $codepage = $this->_GetInt2d($recordData, 0); + $codepage = self::_GetInt2d($recordData, 0); $this->_codepage = PHPExcel_Shared_CodePage::NumberToName($codepage); } @@ -1376,7 +1375,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readDateMode() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -1394,7 +1393,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readFont() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -1404,26 +1403,26 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $objFont = new PHPExcel_Style_Font(); // offset: 0; size: 2; height of the font (in twips = 1/20 of a point) - $size = $this->_GetInt2d($recordData, 0); + $size = self::_GetInt2d($recordData, 0); $objFont->setSize($size / 20); // offset: 2; size: 2; option flags // bit: 0; mask 0x0001; bold (redundant in BIFF5-BIFF8) // bit: 1; mask 0x0002; italic - $isItalic = (0x0002 & $this->_GetInt2d($recordData, 2)) >> 1; + $isItalic = (0x0002 & self::_GetInt2d($recordData, 2)) >> 1; if ($isItalic) $objFont->setItalic(true); // bit: 2; mask 0x0004; underlined (redundant in BIFF5-BIFF8) // bit: 3; mask 0x0008; strike - $isStrike = (0x0008 & $this->_GetInt2d($recordData, 2)) >> 3; + $isStrike = (0x0008 & self::_GetInt2d($recordData, 2)) >> 3; if ($isStrike) $objFont->setStrikethrough(true); // offset: 4; size: 2; colour index - $colorIndex = $this->_GetInt2d($recordData, 4); + $colorIndex = self::_GetInt2d($recordData, 4); $objFont->colorIndex = $colorIndex; // offset: 6; size: 2; font weight - $weight = $this->_GetInt2d($recordData, 6); + $weight = self::_GetInt2d($recordData, 6); switch ($weight) { case 0x02BC: $objFont->setBold(true); @@ -1431,7 +1430,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader } // offset: 8; size: 2; escapement type - $escapement = $this->_GetInt2d($recordData, 8); + $escapement = self::_GetInt2d($recordData, 8); switch ($escapement) { case 0x0001: $objFont->setSuperScript(true); @@ -1465,7 +1464,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 13; size: 1; not used // offset: 14; size: var; font name if ($this->_version == self::XLS_BIFF8) { - $string = $this->_readUnicodeStringShort(substr($recordData, 14)); + $string = self::_readUnicodeStringShort(substr($recordData, 14)); } else { $string = $this->_readByteStringShort(substr($recordData, 14)); } @@ -1491,17 +1490,17 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readFormat() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; if (!$this->_readDataOnly) { - $indexCode = $this->_GetInt2d($recordData, 0); + $indexCode = self::_GetInt2d($recordData, 0); if ($this->_version == self::XLS_BIFF8) { - $string = $this->_readUnicodeStringLong(substr($recordData, 2)); + $string = self::_readUnicodeStringLong(substr($recordData, 2)); } else { // BIFF7 $string = $this->_readByteStringShort(substr($recordData, 2)); @@ -1528,7 +1527,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readXf() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -1538,17 +1537,17 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 2; Index to FONT record - if ($this->_GetInt2d($recordData, 0) < 4) { - $fontIndex = $this->_GetInt2d($recordData, 0); + if (self::_GetInt2d($recordData, 0) < 4) { + $fontIndex = self::_GetInt2d($recordData, 0); } else { // this has to do with that index 4 is omitted in all BIFF versions for some strange reason // check the OpenOffice documentation of the FONT record - $fontIndex = $this->_GetInt2d($recordData, 0) - 1; + $fontIndex = self::_GetInt2d($recordData, 0) - 1; } $objStyle->setFont($this->_objFonts[$fontIndex]); // offset: 2; size: 2; Index to FORMAT record - $numberFormatIndex = $this->_GetInt2d($recordData, 2); + $numberFormatIndex = self::_GetInt2d($recordData, 2); if (isset($this->_formats[$numberFormatIndex])) { // then we have user-defined format code $numberformat = array('code' => $this->_formats[$numberFormatIndex]); @@ -1563,7 +1562,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 4; size: 2; XF type, cell protection, and parent style XF // bit 2-0; mask 0x0007; XF_TYPE_PROT - $xfTypeProt = $this->_GetInt2d($recordData, 4); + $xfTypeProt = self::_GetInt2d($recordData, 4); // bit 0; mask 0x01; 1 = cell is locked $isLocked = (0x01 & $xfTypeProt) >> 0; $objStyle->getProtection()->setLocked($isLocked ? @@ -1660,33 +1659,33 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 10; size: 4; Cell border lines and background area // bit: 3-0; mask: 0x0000000F; left style - if ($bordersLeftStyle = $this->_mapBorderStyle((0x0000000F & $this->_GetInt4d($recordData, 10)) >> 0)) { + if ($bordersLeftStyle = self::_mapBorderStyle((0x0000000F & self::_GetInt4d($recordData, 10)) >> 0)) { $objStyle->getBorders()->getLeft()->setBorderStyle($bordersLeftStyle); } // bit: 7-4; mask: 0x000000F0; right style - if ($bordersRightStyle = $this->_mapBorderStyle((0x000000F0 & $this->_GetInt4d($recordData, 10)) >> 4)) { + if ($bordersRightStyle = self::_mapBorderStyle((0x000000F0 & self::_GetInt4d($recordData, 10)) >> 4)) { $objStyle->getBorders()->getRight()->setBorderStyle($bordersRightStyle); } // bit: 11-8; mask: 0x00000F00; top style - if ($bordersTopStyle = $this->_mapBorderStyle((0x00000F00 & $this->_GetInt4d($recordData, 10)) >> 8)) { + if ($bordersTopStyle = self::_mapBorderStyle((0x00000F00 & self::_GetInt4d($recordData, 10)) >> 8)) { $objStyle->getBorders()->getTop()->setBorderStyle($bordersTopStyle); } // bit: 15-12; mask: 0x0000F000; bottom style - if ($bordersBottomStyle = $this->_mapBorderStyle((0x0000F000 & $this->_GetInt4d($recordData, 10)) >> 12)) { + if ($bordersBottomStyle = self::_mapBorderStyle((0x0000F000 & self::_GetInt4d($recordData, 10)) >> 12)) { $objStyle->getBorders()->getBottom()->setBorderStyle($bordersBottomStyle); } // bit: 22-16; mask: 0x007F0000; left color - $objStyle->getBorders()->getLeft()->colorIndex = (0x007F0000 & $this->_GetInt4d($recordData, 10)) >> 16; + $objStyle->getBorders()->getLeft()->colorIndex = (0x007F0000 & self::_GetInt4d($recordData, 10)) >> 16; // bit: 29-23; mask: 0x3F800000; right color - $objStyle->getBorders()->getRight()->colorIndex = (0x3F800000 & $this->_GetInt4d($recordData, 10)) >> 23; + $objStyle->getBorders()->getRight()->colorIndex = (0x3F800000 & self::_GetInt4d($recordData, 10)) >> 23; // bit: 30; mask: 0x40000000; 1 = diagonal line from top left to right bottom - $diagonalDown = (0x40000000 & $this->_GetInt4d($recordData, 10)) >> 30 ? + $diagonalDown = (0x40000000 & self::_GetInt4d($recordData, 10)) >> 30 ? true : false; // bit: 31; mask: 0x80000000; 1 = diagonal line from bottom left to top right - $diagonalUp = (0x80000000 & $this->_GetInt4d($recordData, 10)) >> 31 ? + $diagonalUp = (0x80000000 & self::_GetInt4d($recordData, 10)) >> 31 ? true : false; if ($diagonalUp == false && $diagonalDown == false) { @@ -1701,29 +1700,29 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 14; size: 4; // bit: 6-0; mask: 0x0000007F; top color - $objStyle->getBorders()->getTop()->colorIndex = (0x0000007F & $this->_GetInt4d($recordData, 14)) >> 0; + $objStyle->getBorders()->getTop()->colorIndex = (0x0000007F & self::_GetInt4d($recordData, 14)) >> 0; // bit: 13-7; mask: 0x00003F80; bottom color - $objStyle->getBorders()->getBottom()->colorIndex = (0x00003F80 & $this->_GetInt4d($recordData, 14)) >> 7; + $objStyle->getBorders()->getBottom()->colorIndex = (0x00003F80 & self::_GetInt4d($recordData, 14)) >> 7; // bit: 20-14; mask: 0x001FC000; diagonal color - $objStyle->getBorders()->getDiagonal()->colorIndex = (0x001FC000 & $this->_GetInt4d($recordData, 14)) >> 14; + $objStyle->getBorders()->getDiagonal()->colorIndex = (0x001FC000 & self::_GetInt4d($recordData, 14)) >> 14; // bit: 24-21; mask: 0x01E00000; diagonal style - if ($bordersDiagonalStyle = $this->_mapBorderStyle((0x01E00000 & $this->_GetInt4d($recordData, 14)) >> 21)) { + if ($bordersDiagonalStyle = self::_mapBorderStyle((0x01E00000 & self::_GetInt4d($recordData, 14)) >> 21)) { $objStyle->getBorders()->getDiagonal()->setBorderStyle($bordersDiagonalStyle); } // bit: 31-26; mask: 0xFC000000 fill pattern - if ($fillType = $this->_mapFillPattern((0xFC000000 & $this->_GetInt4d($recordData, 14)) >> 26)) { + if ($fillType = self::_mapFillPattern((0xFC000000 & self::_GetInt4d($recordData, 14)) >> 26)) { $objStyle->getFill()->setFillType($fillType); } // offset: 18; size: 2; pattern and background colour // bit: 6-0; mask: 0x007F; color index for pattern color - $objStyle->getFill()->startcolorIndex = (0x007F & $this->_GetInt2d($recordData, 18)) >> 0; + $objStyle->getFill()->startcolorIndex = (0x007F & self::_GetInt2d($recordData, 18)) >> 0; // bit: 13-7; mask: 0x3F80; color index for pattern background - $objStyle->getFill()->endcolorIndex = (0x3F80 & $this->_GetInt2d($recordData, 18)) >> 7; + $objStyle->getFill()->endcolorIndex = (0x3F80 & self::_GetInt2d($recordData, 18)) >> 7; } else { // BIFF5 @@ -1748,7 +1747,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader } // offset: 8; size: 4; cell border lines and background area - $borderAndBackground = $this->_GetInt4d($recordData, 8); + $borderAndBackground = self::_GetInt4d($recordData, 8); // bit: 6-0; mask: 0x0000007F; color index for pattern color $objStyle->getFill()->startcolorIndex = (0x0000007F & $borderAndBackground) >> 0; @@ -1757,25 +1756,25 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $objStyle->getFill()->endcolorIndex = (0x00003F80 & $borderAndBackground) >> 7; // bit: 21-16; mask: 0x003F0000; fill pattern - $objStyle->getFill()->setFillType($this->_mapFillPattern((0x003F0000 & $borderAndBackground) >> 16)); + $objStyle->getFill()->setFillType(self::_mapFillPattern((0x003F0000 & $borderAndBackground) >> 16)); // bit: 24-22; mask: 0x01C00000; bottom line style - $objStyle->getBorders()->getBottom()->setBorderStyle($this->_mapBorderStyle((0x01C00000 & $borderAndBackground) >> 22)); + $objStyle->getBorders()->getBottom()->setBorderStyle(self::_mapBorderStyle((0x01C00000 & $borderAndBackground) >> 22)); // bit: 31-25; mask: 0xFE000000; bottom line color $objStyle->getBorders()->getBottom()->colorIndex = (0xFE000000 & $borderAndBackground) >> 25; // offset: 12; size: 4; cell border lines - $borderLines = $this->_GetInt4d($recordData, 12); + $borderLines = self::_GetInt4d($recordData, 12); // bit: 2-0; mask: 0x00000007; top line style - $objStyle->getBorders()->getTop()->setBorderStyle($this->_mapBorderStyle((0x00000007 & $borderLines) >> 0)); + $objStyle->getBorders()->getTop()->setBorderStyle(self::_mapBorderStyle((0x00000007 & $borderLines) >> 0)); // bit: 5-3; mask: 0x00000038; left line style - $objStyle->getBorders()->getLeft()->setBorderStyle($this->_mapBorderStyle((0x00000038 & $borderLines) >> 3)); + $objStyle->getBorders()->getLeft()->setBorderStyle(self::_mapBorderStyle((0x00000038 & $borderLines) >> 3)); // bit: 8-6; mask: 0x000001C0; right line style - $objStyle->getBorders()->getRight()->setBorderStyle($this->_mapBorderStyle((0x000001C0 & $borderLines) >> 6)); + $objStyle->getBorders()->getRight()->setBorderStyle(self::_mapBorderStyle((0x000001C0 & $borderLines) >> 6)); // bit: 15-9; mask: 0x0000FE00; top line color index $objStyle->getBorders()->getTop()->colorIndex = (0x0000FE00 & $borderLines) >> 9; @@ -1810,7 +1809,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readXfExt() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -1826,28 +1825,28 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 12; size: 2; record version // offset: 14; size: 2; index to XF record which this record modifies - $ixfe = $this->_GetInt2d($recordData, 14); + $ixfe = self::_GetInt2d($recordData, 14); // offset: 16; size: 2; not used // offset: 18; size: 2; number of extension properties that follow - $cexts = $this->_GetInt2d($recordData, 18); + $cexts = self::_GetInt2d($recordData, 18); // start reading the actual extension data $offset = 20; while ($offset < $length) { // extension type - $extType = $this->_GetInt2d($recordData, $offset); + $extType = self::_GetInt2d($recordData, $offset); // extension length - $cb = $this->_GetInt2d($recordData, $offset + 2); + $cb = self::_GetInt2d($recordData, $offset + 2); // extension data $extData = substr($recordData, $offset + 4, $cb); switch ($extType) { case 4: // fill start color - $xclfType = $this->_GetInt2d($extData, 0); // color type + $xclfType = self::_GetInt2d($extData, 0); // color type $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { @@ -1863,7 +1862,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; case 5: // fill end color - $xclfType = $this->_GetInt2d($extData, 0); // color type + $xclfType = self::_GetInt2d($extData, 0); // color type $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { @@ -1879,7 +1878,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; case 7: // border color top - $xclfType = $this->_GetInt2d($extData, 0); // color type + $xclfType = self::_GetInt2d($extData, 0); // color type $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { @@ -1895,7 +1894,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; case 8: // border color bottom - $xclfType = $this->_GetInt2d($extData, 0); // color type + $xclfType = self::_GetInt2d($extData, 0); // color type $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { @@ -1911,7 +1910,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; case 9: // border color left - $xclfType = $this->_GetInt2d($extData, 0); // color type + $xclfType = self::_GetInt2d($extData, 0); // color type $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { @@ -1927,7 +1926,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; case 10: // border color right - $xclfType = $this->_GetInt2d($extData, 0); // color type + $xclfType = self::_GetInt2d($extData, 0); // color type $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { @@ -1943,7 +1942,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; case 11: // border color diagonal - $xclfType = $this->_GetInt2d($extData, 0); // color type + $xclfType = self::_GetInt2d($extData, 0); // color type $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { @@ -1959,7 +1958,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; case 13: // font color - $xclfType = $this->_GetInt2d($extData, 0); // color type + $xclfType = self::_GetInt2d($extData, 0); // color type $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { @@ -1986,7 +1985,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readStyle() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -1994,7 +1993,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 2; index to XF record and flag for built-in style - $ixfe = $this->_GetInt2d($recordData, 0); + $ixfe = self::_GetInt2d($recordData, 0); // bit: 11-0; mask 0x0FFF; index to XF record $xfIndex = (0x0FFF & $ixfe) >> 0; @@ -2026,7 +2025,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readPalette() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2034,12 +2033,12 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 2; number of following colors - $nm = $this->_GetInt2d($recordData, 0); + $nm = self::_GetInt2d($recordData, 0); // list of RGB colors for ($i = 0; $i < $nm; ++$i) { $rgb = substr($recordData, 2 + 4 * $i, 4); - $this->_palette[] = $this->_readRGB($rgb); + $this->_palette[] = self::_readRGB($rgb); } } } @@ -2058,14 +2057,14 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readSheet() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 4; absolute stream position of the BOF record of the sheet - $rec_offset = $this->_GetInt4d($recordData, 0); + $rec_offset = self::_GetInt4d($recordData, 0); // offset: 4; size: 1; sheet state switch (ord($recordData{4})) { @@ -2080,7 +2079,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 6; size: var; sheet name if ($this->_version == self::XLS_BIFF8) { - $string = $this->_readUnicodeStringShort(substr($recordData, 6)); + $string = self::_readUnicodeStringShort(substr($recordData, 6)); $rec_name = $string['value']; } elseif ($this->_version == self::XLS_BIFF7) { $string = $this->_readByteStringShort(substr($recordData, 6)); @@ -2100,7 +2099,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readExternalBook() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2113,17 +2112,17 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (strlen($recordData) > 4) { // external reference // offset: 0; size: 2; number of sheet names ($nm) - $nm = $this->_GetInt2d($recordData, 0); + $nm = self::_GetInt2d($recordData, 0); $offset += 2; // offset: 2; size: var; encoded URL without sheet name (Unicode string, 16-bit length) - $encodedUrlString = $this->_readUnicodeStringLong(substr($recordData, 2)); + $encodedUrlString = self::_readUnicodeStringLong(substr($recordData, 2)); $offset += $encodedUrlString['size']; // offset: var; size: var; list of $nm sheet names (Unicode strings, 16-bit length) $externalSheetNames = array(); for ($i = 0; $i < $nm; ++$i) { - $externalSheetNameString = $this->_readUnicodeStringLong(substr($recordData, $offset)); + $externalSheetNameString = self::_readUnicodeStringLong(substr($recordData, $offset)); $externalSheetNames[] = $externalSheetNameString['value']; $offset += $externalSheetNameString['size']; } @@ -2163,7 +2162,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readExternName() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2172,14 +2171,14 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // external sheet references provided for named cells if ($this->_version == self::XLS_BIFF8) { // offset: 0; size: 2; options - $options = $this->_GetInt2d($recordData, 0); + $options = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; // offset: 4; size: 2; not used // offset: 6; size: var - $nameString = $this->_readUnicodeStringShort(substr($recordData, 6)); + $nameString = self::_readUnicodeStringShort(substr($recordData, 6)); // offset: var; size: var; formula data $offset = 6 + $nameString['size']; @@ -2197,7 +2196,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readExternSheet() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2206,15 +2205,15 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // external sheet references provided for named cells if ($this->_version == self::XLS_BIFF8) { // offset: 0; size: 2; number of following ref structures - $nm = $this->_GetInt2d($recordData, 0); + $nm = self::_GetInt2d($recordData, 0); for ($i = 0; $i < $nm; ++$i) { $this->_ref[] = array( // offset: 2 + 6 * $i; index to EXTERNALBOOK record - 'externalBookIndex' => $this->_GetInt2d($recordData, 2 + 6 * $i), + 'externalBookIndex' => self::_GetInt2d($recordData, 2 + 6 * $i), // offset: 4 + 6 * $i; index to first sheet in EXTERNALBOOK record - 'firstSheetIndex' => $this->_GetInt2d($recordData, 4 + 6 * $i), + 'firstSheetIndex' => self::_GetInt2d($recordData, 4 + 6 * $i), // offset: 6 + 6 * $i; index to last sheet in EXTERNALBOOK record - 'lastSheetIndex' => $this->_GetInt2d($recordData, 6 + 6 * $i), + 'lastSheetIndex' => self::_GetInt2d($recordData, 6 + 6 * $i), ); } } @@ -2233,7 +2232,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readDefinedName() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2243,7 +2242,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // retrieves named cells // offset: 0; size: 2; option flags - $opts = $this->_GetInt2d($recordData, 0); + $opts = self::_GetInt2d($recordData, 0); // bit: 5; mask: 0x0020; 0 = user-defined name, 1 = built-in-name $isBuiltInName = (0x0020 & $opts) >> 5; @@ -2255,13 +2254,13 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // 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 - $flen = $this->_GetInt2d($recordData, 4); + $flen = self::_GetInt2d($recordData, 4); // offset: 8; size: 2; 0=Global name, otherwise index to sheet (1-based) - $scope = $this->_GetInt2d($recordData, 8); + $scope = self::_GetInt2d($recordData, 8); // offset: 14; size: var; Name (Unicode string without length field) - $string = $this->_readUnicodeString(substr($recordData, 14), $nlen); + $string = self::_readUnicodeString(substr($recordData, 14), $nlen); // offset: var; size: $flen; formula data $offset = 14 + $string['size']; @@ -2287,7 +2286,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readMsoDrawingGroup() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); // get spliced record data $splicedRecordData = $this->_getSplicedRecordData(); @@ -2322,14 +2321,14 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $pos += 4; // offset: 4; size: 4; number of following strings ($nm) - $nm = $this->_GetInt4d($recordData, 4); + $nm = self::_GetInt4d($recordData, 4); $pos += 4; // loop through the Unicode strings (16-bit length) for ($i = 0; $i < $nm; ++$i) { // number of characters in the Unicode string - $numChars = $this->_GetInt2d($recordData, $pos); + $numChars = self::_GetInt2d($recordData, $pos); $pos += 2; // option flags @@ -2347,13 +2346,13 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if ($hasRichText) { // number of Rich-Text formatting runs - $formattingRuns = $this->_GetInt2d($recordData, $pos); + $formattingRuns = self::_GetInt2d($recordData, $pos); $pos += 2; } if ($hasAsian) { // size of Asian phonetic setting - $extendedRunLength = $this->_GetInt4d($recordData, $pos); + $extendedRunLength = self::_GetInt4d($recordData, $pos); $pos += 4; } @@ -2450,7 +2449,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader } // convert to UTF-8 - $retstr = $this->_encodeUTF16($retstr, $isCompressed); + $retstr = self::_encodeUTF16($retstr, $isCompressed); // read additional Rich-Text information, if any $fmtRuns = array(); @@ -2458,10 +2457,10 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // list of formatting runs for ($j = 0; $j < $formattingRuns; ++$j) { // first formatted character; zero-based - $charPos = $this->_GetInt2d($recordData, $pos + $j * 4); + $charPos = self::_GetInt2d($recordData, $pos + $j * 4); // index to font record - $fontIndex = $this->_GetInt2d($recordData, $pos + 2 + $j * 4); + $fontIndex = self::_GetInt2d($recordData, $pos + 2 + $j * 4); $fmtRuns[] = array( 'charPos' => $charPos, @@ -2492,7 +2491,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readPrintGridlines() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2500,7 +2499,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if ($this->_version == self::XLS_BIFF8 && !$this->_readDataOnly) { // offset: 0; size: 2; 0 = do not print sheet grid lines; 1 = print sheet gridlines - $printGridlines = (bool) $this->_GetInt2d($recordData, 0); + $printGridlines = (bool) self::_GetInt2d($recordData, 0); $this->_phpSheet->setPrintGridlines($printGridlines); } } @@ -2510,7 +2509,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readDefaultRowHeight() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2518,7 +2517,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 0; size: 2; option flags // offset: 2; size: 2; default height for unused rows, (twips 1/20 point) - $height = $this->_GetInt2d($recordData, 2); + $height = self::_GetInt2d($recordData, 2); $this->_phpSheet->getDefaultRowDimension()->setRowHeight($height / 20); } @@ -2527,7 +2526,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readSheetPr() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2536,16 +2535,16 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 0; size: 2 // bit: 6; mask: 0x0040; 0 = outline buttons above outline group - $isSummaryBelow = (0x0040 & $this->_GetInt2d($recordData, 0)) >> 6; + $isSummaryBelow = (0x0040 & self::_GetInt2d($recordData, 0)) >> 6; $this->_phpSheet->setShowSummaryBelow($isSummaryBelow); // bit: 7; mask: 0x0080; 0 = outline buttons left of outline group - $isSummaryRight = (0x0080 & $this->_GetInt2d($recordData, 0)) >> 7; + $isSummaryRight = (0x0080 & self::_GetInt2d($recordData, 0)) >> 7; $this->_phpSheet->setShowSummaryRight($isSummaryRight); // bit: 8; mask: 0x100; 0 = scale printout in percent, 1 = fit printout to number of pages // this corresponds to radio button setting in page setup dialog in Excel - $this->_isFitToPages = (bool) ((0x0100 & $this->_GetInt2d($recordData, 0)) >> 8); + $this->_isFitToPages = (bool) ((0x0100 & self::_GetInt2d($recordData, 0)) >> 8); } /** @@ -2553,7 +2552,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readHorizontalPageBreaks() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2562,13 +2561,13 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if ($this->_version == self::XLS_BIFF8 && !$this->_readDataOnly) { // offset: 0; size: 2; number of the following row index structures - $nm = $this->_GetInt2d($recordData, 0); + $nm = self::_GetInt2d($recordData, 0); // offset: 2; size: 6 * $nm; list of $nm row index structures for ($i = 0; $i < $nm; ++$i) { - $r = $this->_GetInt2d($recordData, 2 + 6 * $i); - $cf = $this->_GetInt2d($recordData, 2 + 6 * $i + 2); - $cl = $this->_GetInt2d($recordData, 2 + 6 * $i + 4); + $r = self::_GetInt2d($recordData, 2 + 6 * $i); + $cf = self::_GetInt2d($recordData, 2 + 6 * $i + 2); + $cl = self::_GetInt2d($recordData, 2 + 6 * $i + 4); // not sure why two column indexes are necessary? $this->_phpSheet->setBreakByColumnAndRow($cf, $r, PHPExcel_Worksheet::BREAK_ROW); @@ -2581,7 +2580,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readVerticalPageBreaks() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2589,13 +2588,13 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if ($this->_version == self::XLS_BIFF8 && !$this->_readDataOnly) { // offset: 0; size: 2; number of the following column index structures - $nm = $this->_GetInt2d($recordData, 0); + $nm = self::_GetInt2d($recordData, 0); // offset: 2; size: 6 * $nm; list of $nm row index structures for ($i = 0; $i < $nm; ++$i) { - $c = $this->_GetInt2d($recordData, 2 + 6 * $i); - $rf = $this->_GetInt2d($recordData, 2 + 6 * $i + 2); - $rl = $this->_GetInt2d($recordData, 2 + 6 * $i + 4); + $c = self::_GetInt2d($recordData, 2 + 6 * $i); + $rf = self::_GetInt2d($recordData, 2 + 6 * $i + 2); + $rl = self::_GetInt2d($recordData, 2 + 6 * $i + 4); // not sure why two row indexes are necessary? $this->_phpSheet->setBreakByColumnAndRow($c, $rf, PHPExcel_Worksheet::BREAK_COLUMN); @@ -2608,7 +2607,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readHeader() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2619,7 +2618,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // realized that $recordData can be empty even when record exists if ($recordData) { if ($this->_version == self::XLS_BIFF8) { - $string = $this->_readUnicodeStringLong($recordData); + $string = self::_readUnicodeStringLong($recordData); } else { $string = $this->_readByteStringShort($recordData); } @@ -2635,7 +2634,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readFooter() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2646,7 +2645,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // realized that $recordData can be empty even when record exists if ($recordData) { if ($this->_version == self::XLS_BIFF8) { - $string = $this->_readUnicodeStringLong($recordData); + $string = self::_readUnicodeStringLong($recordData); } else { $string = $this->_readByteStringShort($recordData); } @@ -2661,7 +2660,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readHcenter() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2669,7 +2668,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 2; 0 = print sheet left aligned, 1 = print sheet centered horizontally - $isHorizontalCentered = (bool) $this->_GetInt2d($recordData, 0); + $isHorizontalCentered = (bool) self::_GetInt2d($recordData, 0); $this->_phpSheet->getPageSetup()->setHorizontalCentered($isHorizontalCentered); } @@ -2680,7 +2679,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readVcenter() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2688,7 +2687,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 2; 0 = print sheet aligned at top page border, 1 = print sheet vertically centered - $isVerticalCentered = (bool) $this->_GetInt2d($recordData, 0); + $isVerticalCentered = (bool) self::_GetInt2d($recordData, 0); $this->_phpSheet->getPageSetup()->setVerticalCentered($isVerticalCentered); } @@ -2699,7 +2698,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readLeftMargin() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2707,7 +2706,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 8 - $this->_phpSheet->getPageMargins()->setLeft($this->_extractNumber($recordData)); + $this->_phpSheet->getPageMargins()->setLeft(self::_extractNumber($recordData)); } } @@ -2716,7 +2715,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readRightMargin() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2724,7 +2723,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 8 - $this->_phpSheet->getPageMargins()->setRight($this->_extractNumber($recordData)); + $this->_phpSheet->getPageMargins()->setRight(self::_extractNumber($recordData)); } } @@ -2733,7 +2732,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readTopMargin() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2741,7 +2740,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 8 - $this->_phpSheet->getPageMargins()->setTop($this->_extractNumber($recordData)); + $this->_phpSheet->getPageMargins()->setTop(self::_extractNumber($recordData)); } } @@ -2750,7 +2749,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readBottomMargin() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2758,7 +2757,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 8 - $this->_phpSheet->getPageMargins()->setBottom($this->_extractNumber($recordData)); + $this->_phpSheet->getPageMargins()->setBottom(self::_extractNumber($recordData)); } } @@ -2767,7 +2766,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readPageSetup() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2775,25 +2774,25 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 2; paper size - $paperSize = $this->_GetInt2d($recordData, 0); + $paperSize = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; scaling factor - $scale = $this->_GetInt2d($recordData, 2); + $scale = self::_GetInt2d($recordData, 2); // offset: 6; size: 2; fit worksheet width to this number of pages, 0 = use as many as needed - $fitToWidth = $this->_GetInt2d($recordData, 6); + $fitToWidth = self::_GetInt2d($recordData, 6); // offset: 8; size: 2; fit worksheet height to this number of pages, 0 = use as many as needed - $fitToHeight = $this->_GetInt2d($recordData, 8); + $fitToHeight = self::_GetInt2d($recordData, 8); // offset: 10; size: 2; option flags // bit: 1; mask: 0x0002; 0=landscape, 1=portrait - $isPortrait = (0x0002 & $this->_GetInt2d($recordData, 10)) >> 1; + $isPortrait = (0x0002 & self::_GetInt2d($recordData, 10)) >> 1; // bit: 2; mask: 0x0004; 1= paper size, scaling factor, paper orient. not init // when this bit is set, do not use flags for those properties - $isNotInit = (0x0004 & $this->_GetInt2d($recordData, 10)) >> 2; + $isNotInit = (0x0004 & self::_GetInt2d($recordData, 10)) >> 2; if (!$isNotInit) { $this->_phpSheet->getPageSetup()->setPaperSize($paperSize); @@ -2809,11 +2808,11 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader } // offset: 16; size: 8; header margin (IEEE 754 floating-point value) - $marginHeader = $this->_extractNumber(substr($recordData, 16, 8)); + $marginHeader = self::_extractNumber(substr($recordData, 16, 8)); $this->_phpSheet->getPageMargins()->setHeader($marginHeader); // offset: 24; size: 8; footer margin (IEEE 754 floating-point value) - $marginFooter = $this->_extractNumber(substr($recordData, 24, 8)); + $marginFooter = self::_extractNumber(substr($recordData, 24, 8)); $this->_phpSheet->getPageMargins()->setFooter($marginFooter); } } @@ -2824,7 +2823,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readProtect() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2837,7 +2836,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 0; size: 2; // bit 0, mask 0x01; 1 = sheet is protected - $bool = (0x01 & $this->_GetInt2d($recordData, 0)) >> 0; + $bool = (0x01 & self::_GetInt2d($recordData, 0)) >> 0; $this->_phpSheet->getProtection()->setSheet((bool)$bool); } @@ -2846,7 +2845,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readScenProtect() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2859,7 +2858,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 0; size: 2; // bit: 0, mask 0x01; 1 = scenarios are protected - $bool = (0x01 & $this->_GetInt2d($recordData, 0)) >> 0; + $bool = (0x01 & self::_GetInt2d($recordData, 0)) >> 0; $this->_phpSheet->getProtection()->setScenarios((bool)$bool); } @@ -2869,7 +2868,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readObjectProtect() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2882,7 +2881,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 0; size: 2; // bit: 0, mask 0x01; 1 = objects are protected - $bool = (0x01 & $this->_GetInt2d($recordData, 0)) >> 0; + $bool = (0x01 & self::_GetInt2d($recordData, 0)) >> 0; $this->_phpSheet->getProtection()->setObjects((bool)$bool); } @@ -2892,7 +2891,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readPassword() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2900,7 +2899,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 2; 16-bit hash value of password - $password = strtoupper(dechex($this->_GetInt2d($recordData, 0))); // the hashed password + $password = strtoupper(dechex(self::_GetInt2d($recordData, 0))); // the hashed password $this->_phpSheet->getProtection()->setPassword($password, true); } } @@ -2910,14 +2909,14 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readDefColWidth() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; default column width - $width = $this->_GetInt2d($recordData, 0); + $width = self::_GetInt2d($recordData, 0); if ($width != 8) { $this->_phpSheet->getDefaultColumnDimension()->setWidth($width); } @@ -2928,7 +2927,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readColInfo() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2936,27 +2935,27 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 2; index to first column in range - $fc = $this->_GetInt2d($recordData, 0); // first column index + $fc = self::_GetInt2d($recordData, 0); // first column index // offset: 2; size: 2; index to last column in range - $lc = $this->_GetInt2d($recordData, 2); // first column index + $lc = self::_GetInt2d($recordData, 2); // first column index // offset: 4; size: 2; width of the column in 1/256 of the width of the zero character - $width = $this->_GetInt2d($recordData, 4); + $width = self::_GetInt2d($recordData, 4); // offset: 6; size: 2; index to XF record for default column formatting - $xfIndex = $this->_GetInt2d($recordData, 6); + $xfIndex = self::_GetInt2d($recordData, 6); // offset: 8; size: 2; option flags // bit: 0; mask: 0x0001; 1= columns are hidden - $isHidden = (0x0001 & $this->_GetInt2d($recordData, 8)) >> 0; + $isHidden = (0x0001 & self::_GetInt2d($recordData, 8)) >> 0; // bit: 10-8; mask: 0x0700; outline level of the columns (0 = no outline) - $level = (0x0700 & $this->_GetInt2d($recordData, 8)) >> 8; + $level = (0x0700 & self::_GetInt2d($recordData, 8)) >> 8; // bit: 12; mask: 0x1000; 1 = collapsed - $isCollapsed = (0x1000 & $this->_GetInt2d($recordData, 8)) >> 12; + $isCollapsed = (0x1000 & self::_GetInt2d($recordData, 8)) >> 12; // offset: 10; size: 2; not used @@ -2986,7 +2985,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readRow() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -2994,7 +2993,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 2; index of this row - $r = $this->_GetInt2d($recordData, 0); + $r = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; index to column of the first cell which is described by a cell record @@ -3003,10 +3002,10 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 6; size: 2; // bit: 14-0; mask: 0x7FFF; height of the row, in twips = 1/20 of a point - $height = (0x7FFF & $this->_GetInt2d($recordData, 6)) >> 0; + $height = (0x7FFF & self::_GetInt2d($recordData, 6)) >> 0; // bit: 15: mask: 0x8000; 0 = row has custom height; 1= row has default height - $useDefaultHeight = (0x8000 & $this->_GetInt2d($recordData, 6)) >> 15; + $useDefaultHeight = (0x8000 & self::_GetInt2d($recordData, 6)) >> 15; if (!$useDefaultHeight) { $this->_phpSheet->getRowDimension($r + 1)->setRowHeight($height / 20); @@ -3019,22 +3018,22 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 12; size: 4; option flags and default row formatting // bit: 2-0: mask: 0x00000007; outline level of the row - $level = (0x00000007 & $this->_GetInt4d($recordData, 12)) >> 0; + $level = (0x00000007 & self::_GetInt4d($recordData, 12)) >> 0; $this->_phpSheet->getRowDimension($r + 1)->setOutlineLevel($level); // bit: 4; mask: 0x00000010; 1 = outline group start or ends here... and is collapsed - $isCollapsed = (0x00000010 & $this->_GetInt4d($recordData, 12)) >> 4; + $isCollapsed = (0x00000010 & self::_GetInt4d($recordData, 12)) >> 4; $this->_phpSheet->getRowDimension($r + 1)->setCollapsed($isCollapsed); // bit: 5; mask: 0x00000020; 1 = row is hidden - $isHidden = (0x00000020 & $this->_GetInt4d($recordData, 12)) >> 5; + $isHidden = (0x00000020 & self::_GetInt4d($recordData, 12)) >> 5; $this->_phpSheet->getRowDimension($r + 1)->setVisible(!$isHidden); // bit: 7; mask: 0x00000080; 1 = row has explicit format - $hasExplicitFormat = (0x00000080 & $this->_GetInt4d($recordData, 12)) >> 7; + $hasExplicitFormat = (0x00000080 & self::_GetInt4d($recordData, 12)) >> 7; // bit: 27-16; mask: 0x0FFF0000; only applies when hasExplicitFormat = 1; index to XF record - $xfIndex = (0x0FFF0000 & $this->_GetInt4d($recordData, 12)) >> 16; + $xfIndex = (0x0FFF0000 & self::_GetInt4d($recordData, 12)) >> 16; if ($hasExplicitFormat) { $this->_phpSheet->getRowDimension($r + 1)->setXfIndex($this->_mapCellXfIndex[$xfIndex]); @@ -3055,27 +3054,27 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readRk() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; index to row - $row = $this->_GetInt2d($recordData, 0); + $row = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; index to column - $column = $this->_GetInt2d($recordData, 2); + $column = self::_GetInt2d($recordData, 2); $columnString = PHPExcel_Cell::stringFromColumnIndex($column); // Read cell? if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { // offset: 4; size: 2; index to XF record - $xfIndex = $this->_GetInt2d($recordData, 4); + $xfIndex = self::_GetInt2d($recordData, 4); // offset: 6; size: 4; RK value - $rknum = $this->_GetInt4d($recordData, 6); - $numValue = $this->_GetIEEE754($rknum); + $rknum = self::_GetInt4d($recordData, 6); + $numValue = self::_GetIEEE754($rknum); $cell = $this->_phpSheet->getCell($columnString . ($row + 1)); if (!$this->_readDataOnly) { @@ -3099,26 +3098,26 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readLabelSst() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; index to row - $row = $this->_GetInt2d($recordData, 0); + $row = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; index to column - $column = $this->_GetInt2d($recordData, 2); + $column = self::_GetInt2d($recordData, 2); $columnString = PHPExcel_Cell::stringFromColumnIndex($column); // Read cell? if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { // offset: 4; size: 2; index to XF record - $xfIndex = $this->_GetInt2d($recordData, 4); + $xfIndex = self::_GetInt2d($recordData, 4); // offset: 6; size: 4; index to SST record - $index = $this->_GetInt4d($recordData, 6); + $index = self::_GetInt4d($recordData, 6); // add cell if (($fmtRuns = $this->_sst[$index]['fmtRuns']) && !$this->_readDataOnly) { @@ -3175,20 +3174,20 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readMulRk() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; index to row - $row = $this->_GetInt2d($recordData, 0); + $row = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; index to first column - $colFirst = $this->_GetInt2d($recordData, 2); + $colFirst = self::_GetInt2d($recordData, 2); // offset: var; size: 2; index to last column - $colLast = $this->_GetInt2d($recordData, $length - 2); + $colLast = self::_GetInt2d($recordData, $length - 2); $columns = $colLast - $colFirst + 1; // offset within record data @@ -3201,10 +3200,10 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { // offset: var; size: 2; index to XF record - $xfIndex = $this->_GetInt2d($recordData, $offset); + $xfIndex = self::_GetInt2d($recordData, $offset); // offset: var; size: 4; RK value - $numValue = $this->_GetIEEE754($this->_GetInt4d($recordData, $offset + 2)); + $numValue = self::_GetIEEE754(self::_GetInt4d($recordData, $offset + 2)); $cell = $this->_phpSheet->getCell($columnString . ($row + 1)); if (!$this->_readDataOnly) { // add style @@ -3229,25 +3228,25 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readNumber() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; index to row - $row = $this->_GetInt2d($recordData, 0); + $row = self::_GetInt2d($recordData, 0); // offset: 2; size 2; index to column - $column = $this->_GetInt2d($recordData, 2); + $column = self::_GetInt2d($recordData, 2); $columnString = PHPExcel_Cell::stringFromColumnIndex($column); // Read cell? if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { // offset 4; size: 2; index to XF record - $xfIndex = $this->_GetInt2d($recordData, 4); + $xfIndex = self::_GetInt2d($recordData, 4); - $numValue = $this->_extractNumber(substr($recordData, 6, 8)); + $numValue = self::_extractNumber(substr($recordData, 6, 8)); $cell = $this->_phpSheet->getCell($columnString . ($row + 1)); if (!$this->_readDataOnly) { @@ -3270,24 +3269,24 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readFormula() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; row index - $row = $this->_GetInt2d($recordData, 0); + $row = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; col index - $column = $this->_GetInt2d($recordData, 2); + $column = self::_GetInt2d($recordData, 2); $columnString = PHPExcel_Cell::stringFromColumnIndex($column); // offset: 20: size: variable; formula structure $formulaStructure = substr($recordData, 20); // offset: 14: size: 2; option flags, recalculate always, recalculate on open etc. - $options = $this->_GetInt2d($recordData, 14); + $options = self::_GetInt2d($recordData, 14); // bit: 0; mask: 0x0001; 1 = recalculate always // bit: 1; mask: 0x0002; 1 = calculate on open @@ -3303,8 +3302,8 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if ($isPartOfSharedFormula) { // part of shared formula which means there will be a formula with a tExp token and nothing else // get the base cell, grab tExp token - $baseRow = $this->_GetInt2d($formulaStructure, 3); - $baseCol = $this->_GetInt2d($formulaStructure, 5); + $baseRow = self::_GetInt2d($formulaStructure, 3); + $baseCol = self::_GetInt2d($formulaStructure, 5); $this->_baseCell = PHPExcel_Cell::stringFromColumnIndex($baseCol). ($baseRow + 1); } @@ -3319,7 +3318,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 16: size: 4; not used // offset: 4; size: 2; XF index - $xfIndex = $this->_GetInt2d($recordData, 4); + $xfIndex = self::_GetInt2d($recordData, 4); // offset: 6; size: 8; result of the formula if ( (ord($recordData{6}) == 0) @@ -3330,7 +3329,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $dataType = PHPExcel_Cell_DataType::TYPE_STRING; // read possible SHAREDFMLA record - $code = $this->_GetInt2d($this->_data, $this->_pos); + $code = self::_GetInt2d($this->_data, $this->_pos); if ($code == self::XLS_Type_SHAREDFMLA) { $this->_readSharedFmla(); } @@ -3352,7 +3351,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // Error formula. Error code is in +2 $dataType = PHPExcel_Cell_DataType::TYPE_ERROR; - $value = $this->_mapErrorCode(ord($recordData{8})); + $value = self::_mapErrorCode(ord($recordData{8})); } elseif ((ord($recordData{6}) == 3) && (ord($recordData{12}) == 255) @@ -3366,7 +3365,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // forumla result is a number, first 14 bytes like _NUMBER record $dataType = PHPExcel_Cell_DataType::TYPE_NUMERIC; - $value = $this->_extractNumber(substr($recordData, 6, 8)); + $value = self::_extractNumber(substr($recordData, 6, 8)); } @@ -3410,7 +3409,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readSharedFmla() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -3442,14 +3441,14 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readString() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; if ($this->_version == self::XLS_BIFF8) { - $string = $this->_readUnicodeStringLong($recordData); + $string = self::_readUnicodeStringLong($recordData); $value = $string['value']; } else { $string = $this->_readByteStringLong($recordData); @@ -3469,23 +3468,23 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readBoolErr() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; row index - $row = $this->_GetInt2d($recordData, 0); + $row = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; column index - $column = $this->_GetInt2d($recordData, 2); + $column = self::_GetInt2d($recordData, 2); $columnString = PHPExcel_Cell::stringFromColumnIndex($column); // Read cell? if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { // offset: 4; size: 2; index to XF record - $xfIndex = $this->_GetInt2d($recordData, 4); + $xfIndex = self::_GetInt2d($recordData, 4); // offset: 6; size: 1; the boolean value or error value $boolErr = ord($recordData{6}); @@ -3503,7 +3502,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; case 1: // error type - $value = $this->_mapErrorCode($boolErr); + $value = self::_mapErrorCode($boolErr); // add cell value $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_ERROR); @@ -3527,17 +3526,17 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readMulBlank() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; index to row - $row = $this->_GetInt2d($recordData, 0); + $row = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; index to first column - $fc = $this->_GetInt2d($recordData, 2); + $fc = self::_GetInt2d($recordData, 2); // offset: 4; size: 2 x nc; list of indexes to XF records // add style information @@ -3547,7 +3546,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // Read cell? if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { - $xfIndex = $this->_GetInt2d($recordData, 4 + 2 * $i); + $xfIndex = self::_GetInt2d($recordData, 4 + 2 * $i); $this->_phpSheet->getCell($columnString . ($row + 1))->setXfIndex($this->_mapCellXfIndex[$xfIndex]); } } @@ -3568,28 +3567,28 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readLabel() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; index to row - $row = $this->_GetInt2d($recordData, 0); + $row = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; index to column - $column = $this->_GetInt2d($recordData, 2); + $column = self::_GetInt2d($recordData, 2); $columnString = PHPExcel_Cell::stringFromColumnIndex($column); // Read cell? if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { // offset: 4; size: 2; XF index - $xfIndex = $this->_GetInt2d($recordData, 4); + $xfIndex = self::_GetInt2d($recordData, 4); // add cell value // todo: what if string is very long? continue record if ($this->_version == self::XLS_BIFF8) { - $string = $this->_readUnicodeStringLong(substr($recordData, 6)); + $string = self::_readUnicodeStringLong(substr($recordData, 6)); $value = $string['value']; } else { $string = $this->_readByteStringLong(substr($recordData, 6)); @@ -3610,23 +3609,23 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readBlank() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; row index - $row = $this->_GetInt2d($recordData, 0); + $row = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; col index - $col = $this->_GetInt2d($recordData, 2); + $col = self::_GetInt2d($recordData, 2); $columnString = PHPExcel_Cell::stringFromColumnIndex($col); // Read cell? if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { // offset: 4; size: 2; XF index - $xfIndex = $this->_GetInt2d($recordData, 4); + $xfIndex = self::_GetInt2d($recordData, 4); // add style information if (!$this->_readDataOnly) { @@ -3641,7 +3640,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readMsoDrawing() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); // get spliced record data $splicedRecordData = $this->_getSplicedRecordData(); @@ -3655,7 +3654,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readObj() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -3671,7 +3670,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // data: var; subrecord data // for now, we are just interested in the second subrecord containing the object type - $ot = $this->_GetInt2d($recordData, 4); + $ot = self::_GetInt2d($recordData, 4); $this->_objs[] = array( 'type' => $ot, @@ -3683,14 +3682,14 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readWindow2() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; option flags - $options = $this->_GetInt2d($recordData, 0); + $options = self::_GetInt2d($recordData, 0); // bit: 1; mask: 0x0002; 0 = do not show gridlines, 1 = show gridlines $showGridlines = (bool) ((0x0002 & $options) >> 1); @@ -3718,17 +3717,17 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readScl() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record $this->_pos += 4 + $length; // offset: 0; size: 2; numerator of the view magnification - $numerator = $this->_GetInt2d($recordData, 0); + $numerator = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; numerator of the view magnification - $denumerator = $this->_GetInt2d($recordData, 2); + $denumerator = self::_GetInt2d($recordData, 2); // set the zoom scale (in percent) $this->_phpSheet->getSheetView()->setZoomScale($numerator * 100 / $denumerator); @@ -3739,7 +3738,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readPane() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -3747,10 +3746,10 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 2; position of vertical split - $px = $this->_GetInt2d($recordData, 0); + $px = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; position of horizontal split - $py = $this->_GetInt2d($recordData, 2); + $py = self::_GetInt2d($recordData, 2); if ($this->_frozen) { // frozen panes @@ -3766,7 +3765,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readSelection() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -3777,14 +3776,14 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $paneId = ord($recordData{0}); // offset: 1; size: 2; index to row of the active cell - $r = $this->_GetInt2d($recordData, 1); + $r = self::_GetInt2d($recordData, 1); // offset: 3; size: 2; index to column of the active cell - $c = $this->_GetInt2d($recordData, 3); + $c = self::_GetInt2d($recordData, 3); // offset: 5; size: 2; index into the following cell range list to the // entry that contains the active cell - $index = $this->_GetInt2d($recordData, 5); + $index = self::_GetInt2d($recordData, 5); // offset: 7; size: var; cell range address list containing all selected cell ranges $data = substr($recordData, 7); @@ -3840,7 +3839,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readMergedCells() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -3861,7 +3860,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readHyperLink() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer forward to next record @@ -3882,35 +3881,35 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 28, size: 4; option flags // bit: 0; mask: 0x00000001; 0 = no link or extant, 1 = file link or URL - $isFileLinkOrUrl = (0x00000001 & $this->_GetInt2d($recordData, 28)) >> 0; + $isFileLinkOrUrl = (0x00000001 & self::_GetInt2d($recordData, 28)) >> 0; // bit: 1; mask: 0x00000002; 0 = relative path, 1 = absolute path or URL - $isAbsPathOrUrl = (0x00000001 & $this->_GetInt2d($recordData, 28)) >> 1; + $isAbsPathOrUrl = (0x00000001 & self::_GetInt2d($recordData, 28)) >> 1; // bit: 2 (and 4); mask: 0x00000014; 0 = no description - $hasDesc = (0x00000014 & $this->_GetInt2d($recordData, 28)) >> 2; + $hasDesc = (0x00000014 & self::_GetInt2d($recordData, 28)) >> 2; // bit: 3; mask: 0x00000008; 0 = no text, 1 = has text - $hasText = (0x00000008 & $this->_GetInt2d($recordData, 28)) >> 3; + $hasText = (0x00000008 & self::_GetInt2d($recordData, 28)) >> 3; // bit: 7; mask: 0x00000080; 0 = no target frame, 1 = has target frame - $hasFrame = (0x00000080 & $this->_GetInt2d($recordData, 28)) >> 7; + $hasFrame = (0x00000080 & self::_GetInt2d($recordData, 28)) >> 7; // bit: 8; mask: 0x00000100; 0 = file link or URL, 1 = UNC path (inc. server name) - $isUNC = (0x00000100 & $this->_GetInt2d($recordData, 28)) >> 8; + $isUNC = (0x00000100 & self::_GetInt2d($recordData, 28)) >> 8; // offset within record data $offset = 32; if ($hasDesc) { // offset: 32; size: var; character count of description text - $dl = $this->_GetInt4d($recordData, 32); + $dl = self::_GetInt4d($recordData, 32); // offset: 36; size: var; character array of description text, no Unicode string header, always 16-bit characters, zero terminated - $desc = $this->_encodeUTF16(substr($recordData, 36, 2 * ($dl - 1)), false); + $desc = self::_encodeUTF16(substr($recordData, 36, 2 * ($dl - 1)), false); $offset += 4 + 2 * $dl; } if ($hasFrame) { - $fl = $this->_GetInt4d($recordData, $offset); + $fl = self::_GetInt4d($recordData, $offset); $offset += 4 + 2 * $fl; } @@ -3935,10 +3934,10 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: var; size: 16; GUID of URL Moniker $offset += 16; // offset: var; size: 4; size (in bytes) of character array of the URL including trailing zero word - $us = $this->_GetInt4d($recordData, $offset); + $us = self::_GetInt4d($recordData, $offset); $offset += 4; // offset: var; size: $us; character array of the URL, no Unicode string header, always 16-bit characters, zero-terminated - $url = $this->_encodeUTF16(substr($recordData, $offset, $us - 2), false); + $url = self::_encodeUTF16(substr($recordData, $offset, $us - 2), false); $url .= $hasText ? '#' : ''; $offset += $us; break; @@ -3953,16 +3952,16 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $offset += 16; // offset: var; size: 2; directory up-level count. - $upLevelCount = $this->_GetInt2d($recordData, $offset); + $upLevelCount = self::_GetInt2d($recordData, $offset); $offset += 2; // offset: var; size: 4; character count of the shortened file path and name, including trailing zero word - $sl = $this->_GetInt4d($recordData, $offset); + $sl = self::_GetInt4d($recordData, $offset); $offset += 4; // offset: var; size: sl; character array of the shortened file path and name in 8.3-DOS-format (compressed Unicode string) $shortenedFilePath = substr($recordData, $offset, $sl); - $shortenedFilePath = $this->_encodeUTF16($shortenedFilePath, true); + $shortenedFilePath = self::_encodeUTF16($shortenedFilePath, true); $shortenedFilePath = substr($shortenedFilePath, 0, -1); // remove trailing zero $offset += $sl; @@ -3972,13 +3971,13 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // extended file path // offset: var; size: 4; size of the following file link field including string lenth mark - $sz = $this->_GetInt4d($recordData, $offset); + $sz = self::_GetInt4d($recordData, $offset); $offset += 4; // only present if $sz > 0 if ($sz > 0) { // offset: var; size: 4; size of the character array of the extended file path and name - $xl = $this->_GetInt4d($recordData, $offset); + $xl = self::_GetInt4d($recordData, $offset); $offset += 4; // offset: var; size 2; unknown @@ -3986,7 +3985,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: var; size $xl; character array of the extended file path and name. $extendedFilePath = substr($recordData, $offset, $xl); - $extendedFilePath = $this->_encodeUTF16($extendedFilePath, false); + $extendedFilePath = self::_encodeUTF16($extendedFilePath, false); $offset += $xl; } @@ -4017,10 +4016,10 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if ($hasText) { // offset: var; size: 4; character count of text mark including trailing zero word - $tl = $this->_GetInt4d($recordData, $offset); + $tl = self::_GetInt4d($recordData, $offset); $offset += 4; // offset: var; size: var; character array of the text mark without the # sign, no Unicode header, always 16-bit characters, zero-terminated - $text = $this->_encodeUTF16(substr($recordData, $offset, 2 * ($tl - 1)), false); + $text = self::_encodeUTF16(substr($recordData, $offset, 2 * ($tl - 1)), false); $url .= $text; } @@ -4036,7 +4035,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readDataValidations() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer forward to next record @@ -4048,7 +4047,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readDataValidation() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer forward to next record @@ -4059,7 +4058,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader } // offset: 0; size: 4; Options - $options = $this->_GetInt4d($recordData, 0); + $options = self::_GetInt4d($recordData, 0); // bit: 0-3; mask: 0x0000000F; type $type = (0x0000000F & $options) >> 0; @@ -4113,31 +4112,31 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 4; size: var; title of the prompt box $offset = 4; - $string = $this->_readUnicodeStringLong(substr($recordData, $offset)); + $string = self::_readUnicodeStringLong(substr($recordData, $offset)); $promptTitle = $string['value'] !== chr(0) ? $string['value'] : ''; $offset += $string['size']; // offset: var; size: var; title of the error box - $string = $this->_readUnicodeStringLong(substr($recordData, $offset)); + $string = self::_readUnicodeStringLong(substr($recordData, $offset)); $errorTitle = $string['value'] !== chr(0) ? $string['value'] : ''; $offset += $string['size']; // offset: var; size: var; text of the prompt box - $string = $this->_readUnicodeStringLong(substr($recordData, $offset)); + $string = self::_readUnicodeStringLong(substr($recordData, $offset)); $prompt = $string['value'] !== chr(0) ? $string['value'] : ''; $offset += $string['size']; // offset: var; size: var; text of the error box - $string = $this->_readUnicodeStringLong(substr($recordData, $offset)); + $string = self::_readUnicodeStringLong(substr($recordData, $offset)); $error = $string['value'] !== chr(0) ? $string['value'] : ''; $offset += $string['size']; // offset: var; size: 2; size of the formula data for the first condition - $sz1 = $this->_GetInt2d($recordData, $offset); + $sz1 = self::_GetInt2d($recordData, $offset); $offset += 2; // offset: var; size: 2; not used @@ -4159,7 +4158,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $offset += $sz1; // offset: var; size: 2; size of the formula data for the first condition - $sz2 = $this->_GetInt2d($recordData, $offset); + $sz2 = self::_GetInt2d($recordData, $offset); $offset += 2; // offset: var; size: 2; not used @@ -4207,7 +4206,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readSheetLayout() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -4223,12 +4222,12 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 12; size: 4; size of record data // Excel 2003 uses size of 0x14 (documented), Excel 2007 uses size of 0x28 (not documented?) - $sz = $this->_GetInt4d($recordData, 12); + $sz = self::_GetInt4d($recordData, 12); switch ($sz) { case 0x14: // offset: 16; size: 2; color index for sheet tab - $colorIndex = $this->_GetInt2d($recordData, 16); + $colorIndex = self::_GetInt2d($recordData, 16); $color = $this->_readColor($colorIndex); $this->_phpSheet->getTabColor()->setRGB($color['rgb']); break; @@ -4246,7 +4245,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readSheetProtection() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -4263,7 +4262,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 4; size: 8; Currently not used and set to 0 // offset: 12; size: 2; Shared feature type index (2=Enhanced Protetion, 4=SmartTag) - $isf = $this->_GetInt2d($recordData, 12); + $isf = self::_GetInt2d($recordData, 12); if ($isf != 2) { return; } @@ -4274,7 +4273,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // rgbHdrSData, assume "Enhanced Protection" // offset: 19; size: 2; option flags - $options = $this->_GetInt2d($recordData, 19); + $options = self::_GetInt2d($recordData, 19); // bit: 0; mask 0x0001; 1 = user may edit objects, 0 = users must not edit objects $bool = (0x0001 & $options) >> 0; @@ -4346,7 +4345,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readRangeProtection() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // move stream pointer to next record @@ -4359,7 +4358,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $offset += 12; // offset: 12; size: 2; shared feature type, 2 = enhanced protection, 4 = smart tag - $isf = $this->_GetInt2d($recordData, 12); + $isf = self::_GetInt2d($recordData, 12); if ($isf != 2) { // we only read FEAT records of type 2 return; @@ -4369,7 +4368,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $offset += 5; // offset: 19; size: 2; count of ref ranges this feature is on - $cref = $this->_GetInt2d($recordData, 19); + $cref = self::_GetInt2d($recordData, 19); $offset += 2; $offset += 6; @@ -4391,7 +4390,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $offset += 4; // offset: var; size: 4; the encrypted password (only 16-bit although field is 32-bit) - $wPassword = $this->_GetInt4d($recordData, $offset); + $wPassword = self::_GetInt4d($recordData, $offset); $offset += 4; // Apply range protection to sheet @@ -4406,7 +4405,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readImData() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); // get spliced record data $splicedRecordData = $this->_getSplicedRecordData(); @@ -4415,13 +4414,13 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // UNDER CONSTRUCTION // offset: 0; size: 2; image format - $cf = $this->_GetInt2d($recordData, 0); + $cf = self::_GetInt2d($recordData, 0); // offset: 2; size: 2; environment from which the file was written - $env = $this->_GetInt2d($recordData, 2); + $env = self::_GetInt2d($recordData, 2); // offset: 4; size: 4; length of the image data - $lcb = $this->_GetInt4d($recordData, 4); + $lcb = self::_GetInt4d($recordData, 4); // offset: 8; size: var; image data $iData = substr($recordData, 8); @@ -4431,22 +4430,22 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // BITMAPCOREINFO // 1. BITMAPCOREHEADER // offset: 0; size: 4; bcSize, Specifies the number of bytes required by the structure - $bcSize = $this->_GetInt4d($iData, 0); + $bcSize = self::_GetInt4d($iData, 0); // var_dump($bcSize); // offset: 4; size: 2; bcWidth, specifies the width of the bitmap, in pixels - $bcWidth = $this->_GetInt2d($iData, 4); + $bcWidth = self::_GetInt2d($iData, 4); // var_dump($bcWidth); // offset: 6; size: 2; bcHeight, specifies the height of the bitmap, in pixels. - $bcHeight = $this->_GetInt2d($iData, 6); + $bcHeight = self::_GetInt2d($iData, 6); // var_dump($bcHeight); $ih = imagecreatetruecolor($bcWidth, $bcHeight); // offset: 8; size: 2; bcPlanes, specifies the number of planes for the target device. This value must be 1 // offset: 10; size: 2; bcBitCount specifies the number of bits-per-pixel. This value must be 1, 4, 8, or 24 - $bcBitCount = $this->_GetInt2d($iData, 10); + $bcBitCount = self::_GetInt2d($iData, 10); // var_dump($bcBitCount); $rgbString = substr($iData, 12); @@ -4488,7 +4487,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader */ private function _readContinue() { - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $recordData = substr($this->_data, $this->_pos + 4, $length); // check if we are reading drawing data @@ -4516,7 +4515,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // 0xF00D MsofbtClientTextbox $validSplitPoints = array(0xF003, 0xF004, 0xF00D); // add identifiers if we find more - $splitPoint = $this->_GetInt2d($recordData, 2); + $splitPoint = self::_GetInt2d($recordData, 2); if (in_array($splitPoint, $validSplitPoints)) { // get spliced record data (and move pointer to next record) $splicedRecordData = $this->_getSplicedRecordData(); @@ -4551,15 +4550,15 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader ++$i; // offset: 0; size: 2; identifier - $identifier = $this->_GetInt2d($this->_data, $this->_pos); + $identifier = self::_GetInt2d($this->_data, $this->_pos); // offset: 2; size: 2; length - $length = $this->_GetInt2d($this->_data, $this->_pos + 2); + $length = self::_GetInt2d($this->_data, $this->_pos + 2); $data .= substr($this->_data, $this->_pos + 4, $length); $spliceOffsets[$i] = $spliceOffsets[$i - 1] + $length; $this->_pos += 4 + $length; - $nextIdentifier = $this->_GetInt2d($this->_data, $this->_pos); + $nextIdentifier = self::_GetInt2d($this->_data, $this->_pos); } while ($nextIdentifier == self::XLS_Type_CONTINUE); @@ -4582,7 +4581,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader private function _getFormulaFromStructure($formulaStructure, $baseCell = 'A1') { // offset: 0; size: 2; size of the following formula data - $sz = $this->_GetInt2d($formulaStructure, 0); + $sz = self::_GetInt2d($formulaStructure, 0); // offset: 2; size: sz $formulaData = substr($formulaStructure, 2, $sz); @@ -4757,7 +4756,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader unset($space2, $space3, $space4, $space5); break; case 'tArray': // array constant - $constantArray = $this->_readBIFF8ConstantArray($additionalData); + $constantArray = self::_readBIFF8ConstantArray($additionalData); $formulaStrings[] = $space1 . $space0 . $constantArray['value']; $additionalData = substr($additionalData, $constantArray['size']); // bite of chunk of additional data unset($space0, $space1); @@ -4845,9 +4844,9 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader case 0x17: // string $name = 'tStr'; // offset: 1; size: var; Unicode string, 8-bit string length - $string = $this->_readUnicodeStringShort(substr($formulaData, 1)); + $string = self::_readUnicodeStringShort(substr($formulaData, 1)); $size = 1 + $string['size']; - $data = $this->_UTF8toExcelDoubleQuoted($string['value']); + $data = self::_UTF8toExcelDoubleQuoted($string['value']); break; case 0x19: // Special attribute // offset: 1; size: 1; attribute type flags: @@ -4865,7 +4864,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader case 0x04: $name = 'tAttrChoose'; // offset: 2; size: 2; number of choices in the CHOOSE function ($nc, number of parameters decreased by 1) - $nc = $this->_GetInt2d($formulaData, 2); + $nc = self::_GetInt2d($formulaData, 2); // offset: 4; size: 2 * $nc // offset: 4 + 2 * $nc; size: 2 $size = 2 * $nc + 6; @@ -4923,7 +4922,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 1; size: 1; error code $name = 'tErr'; $size = 2; - $data = $this->_mapErrorCode(ord($formulaData[1])); + $data = self::_mapErrorCode(ord($formulaData[1])); break; case 0x1D: // boolean // offset: 1; size: 1; 0 = false, 1 = true; @@ -4935,13 +4934,13 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 1; size: 2; unsigned 16-bit integer $name = 'tInt'; $size = 3; - $data = $this->_GetInt2d($formulaData, 1); + $data = self::_GetInt2d($formulaData, 1); break; case 0x1F: // number // offset: 1; size: 8; $name = 'tNum'; $size = 9; - $data = $this->_extractNumber(substr($formulaData, 1)); + $data = self::_extractNumber(substr($formulaData, 1)); $data = str_replace(',', '.', (string)$data); // in case non-English locale break; case 0x20: // array constant @@ -4958,7 +4957,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $name = 'tFunc'; $size = 3; // offset: 1; size: 2; index to built-in sheet function - switch ($this->_GetInt2d($formulaData, 1)) { + switch (self::_GetInt2d($formulaData, 1)) { case 2: $function = 'ISNA'; $args = 1; break; case 3: $function = 'ISERROR'; $args = 1; break; case 10: $function = 'NA'; $args = 0; break; @@ -5132,7 +5131,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 1; size: 1; number of arguments $args = ord($formulaData[1]); // offset: 2: size: 2; index to built-in sheet function - $index = $this->_GetInt2d($formulaData, 2); + $index = self::_GetInt2d($formulaData, 2); switch ($index) { case 0: $function = 'COUNT'; break; case 1: $function = 'IF'; break; @@ -5234,7 +5233,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $name = 'tName'; $size = 5; // offset: 1; size: 2; one-based index to definedname record - $definedNameIndex = $this->_GetInt2d($formulaData, 1) - 1; + $definedNameIndex = self::_GetInt2d($formulaData, 1) - 1; // offset: 2; size: 2; not used $data = $this->_definedname[$definedNameIndex]['name']; break; @@ -5258,7 +5257,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $name = 'tMemArea'; // offset: 1; size: 4; not used // offset: 5; size: 2; size of the following subexpression - $subSize = $this->_GetInt2d($formulaData, 5); + $subSize = self::_GetInt2d($formulaData, 5); $size = 7 + $subSize; $data = $this->_getFormulaFromData(substr($formulaData, 7, $subSize)); break; @@ -5268,7 +5267,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $name = 'tMemErr'; // offset: 1; size: 4; not used // offset: 5; size: 2; size of the following subexpression - $subSize = $this->_GetInt2d($formulaData, 5); + $subSize = self::_GetInt2d($formulaData, 5); $size = 7 + $subSize; $data = $this->_getFormulaFromData(substr($formulaData, 7, $subSize)); break; @@ -5277,7 +5276,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader case 0x69: $name = 'tMemFunc'; // offset: 1; size: 2; size of the following sub-expression - $subSize = $this->_GetInt2d($formulaData, 1); + $subSize = self::_GetInt2d($formulaData, 1); $size = 3 + $subSize; $data = $this->_getFormulaFromData(substr($formulaData, 3, $subSize)); break; @@ -5305,7 +5304,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $size = 7; // offset: 1; size: 2; index to REF entry in EXTERNSHEET record // offset: 3; size: 2; one-based index to DEFINEDNAME or EXTERNNAME record - $index = $this->_GetInt2d($formulaData, 3); + $index = self::_GetInt2d($formulaData, 3); // assume index is to EXTERNNAME record $data = $this->_externalNames[$index - 1]['name']; // offset: 5; size: 2; not used @@ -5319,7 +5318,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader try { // offset: 1; size: 2; index to REF entry - $sheetRange = $this->_readSheetRangeByRefIndex($this->_GetInt2d($formulaData, 1)); + $sheetRange = $this->_readSheetRangeByRefIndex(self::_GetInt2d($formulaData, 1)); // offset: 3; size: 4; cell address $cellAddress = $this->_readBIFF8CellAddress(substr($formulaData, 3, 4)); @@ -5338,7 +5337,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader try { // offset: 1; size: 2; index to REF entry - $sheetRange = $this->_readSheetRangeByRefIndex($this->_GetInt2d($formulaData, 1)); + $sheetRange = $this->_readSheetRangeByRefIndex(self::_GetInt2d($formulaData, 1)); // offset: 3; size: 8; cell address $cellRangeAddress = $this->_readBIFF8CellRangeAddress(substr($formulaData, 3, 8)); @@ -5373,19 +5372,19 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader private function _readBIFF8CellAddress($cellAddressStructure) { // offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767)) - $row = $this->_GetInt2d($cellAddressStructure, 0) + 1; + $row = self::_GetInt2d($cellAddressStructure, 0) + 1; // offset: 2; size: 2; index to column or column offset + relative flags // bit: 7-0; mask 0x00FF; column index - $column = PHPExcel_Cell::stringFromColumnIndex(0x00FF & $this->_GetInt2d($cellAddressStructure, 2)); + $column = PHPExcel_Cell::stringFromColumnIndex(0x00FF & self::_GetInt2d($cellAddressStructure, 2)); // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) - if (!(0x4000 & $this->_GetInt2d($cellAddressStructure, 2))) { + if (!(0x4000 & self::_GetInt2d($cellAddressStructure, 2))) { $column = '$' . $column; } // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) - if (!(0x8000 & $this->_GetInt2d($cellAddressStructure, 2))) { + if (!(0x8000 & self::_GetInt2d($cellAddressStructure, 2))) { $row = '$' . $row; } @@ -5407,16 +5406,16 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $baseCol = PHPExcel_Cell::columnIndexFromString($baseCol) - 1; // offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767)) - $rowIndex = $this->_GetInt2d($cellAddressStructure, 0); - $row = $this->_GetInt2d($cellAddressStructure, 0) + 1; + $rowIndex = self::_GetInt2d($cellAddressStructure, 0); + $row = self::_GetInt2d($cellAddressStructure, 0) + 1; // offset: 2; size: 2; index to column or column offset + relative flags // bit: 7-0; mask 0x00FF; column index - $colIndex = 0x00FF & $this->_GetInt2d($cellAddressStructure, 2); + $colIndex = 0x00FF & self::_GetInt2d($cellAddressStructure, 2); // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) - if (!(0x4000 & $this->_GetInt2d($cellAddressStructure, 2))) { + if (!(0x4000 & self::_GetInt2d($cellAddressStructure, 2))) { $column = PHPExcel_Cell::stringFromColumnIndex($colIndex); $column = '$' . $column; } else { @@ -5425,7 +5424,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader } // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) - if (!(0x8000 & $this->_GetInt2d($cellAddressStructure, 2))) { + if (!(0x8000 & self::_GetInt2d($cellAddressStructure, 2))) { $row = '$' . $row; } else { $rowIndex = ($rowIndex <= 32767) ? $rowIndex : $rowIndex - 65536; @@ -5447,10 +5446,10 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader private function _readBIFF5CellRangeAddressFixed($subData) { // offset: 0; size: 2; index to first row - $fr = $this->_GetInt2d($subData, 0) + 1; + $fr = self::_GetInt2d($subData, 0) + 1; // offset: 2; size: 2; index to last row - $lr = $this->_GetInt2d($subData, 2) + 1; + $lr = self::_GetInt2d($subData, 2) + 1; // offset: 4; size: 1; index to first column $fc = ord($subData{4}); @@ -5485,16 +5484,16 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader private function _readBIFF8CellRangeAddressFixed($subData) { // offset: 0; size: 2; index to first row - $fr = $this->_GetInt2d($subData, 0) + 1; + $fr = self::_GetInt2d($subData, 0) + 1; // offset: 2; size: 2; index to last row - $lr = $this->_GetInt2d($subData, 2) + 1; + $lr = self::_GetInt2d($subData, 2) + 1; // offset: 4; size: 2; index to first column - $fc = $this->_GetInt2d($subData, 4); + $fc = self::_GetInt2d($subData, 4); // offset: 6; size: 2; index to last column - $lc = $this->_GetInt2d($subData, 6); + $lc = self::_GetInt2d($subData, 6); // check values if ($fr > $lr || $fc > $lc) { @@ -5525,38 +5524,38 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // not just return e.g. 'A1' and not 'A1:A1' ? // offset: 0; size: 2; index to first row (0... 65535) (or offset (-32768... 32767)) - $fr = $this->_GetInt2d($subData, 0) + 1; + $fr = self::_GetInt2d($subData, 0) + 1; // offset: 2; size: 2; index to last row (0... 65535) (or offset (-32768... 32767)) - $lr = $this->_GetInt2d($subData, 2) + 1; + $lr = self::_GetInt2d($subData, 2) + 1; // offset: 4; size: 2; index to first column or column offset + relative flags // bit: 7-0; mask 0x00FF; column index - $fc = PHPExcel_Cell::stringFromColumnIndex(0x00FF & $this->_GetInt2d($subData, 4)); + $fc = PHPExcel_Cell::stringFromColumnIndex(0x00FF & self::_GetInt2d($subData, 4)); // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) - if (!(0x4000 & $this->_GetInt2d($subData, 4))) { + if (!(0x4000 & self::_GetInt2d($subData, 4))) { $fc = '$' . $fc; } // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) - if (!(0x8000 & $this->_GetInt2d($subData, 4))) { + if (!(0x8000 & self::_GetInt2d($subData, 4))) { $fr = '$' . $fr; } // offset: 6; size: 2; index to last column or column offset + relative flags // bit: 7-0; mask 0x00FF; column index - $lc = PHPExcel_Cell::stringFromColumnIndex(0x00FF & $this->_GetInt2d($subData, 6)); + $lc = PHPExcel_Cell::stringFromColumnIndex(0x00FF & self::_GetInt2d($subData, 6)); // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) - if (!(0x4000 & $this->_GetInt2d($subData, 6))) { + if (!(0x4000 & self::_GetInt2d($subData, 6))) { $lc = '$' . $lc; } // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) - if (!(0x8000 & $this->_GetInt2d($subData, 6))) { + if (!(0x8000 & self::_GetInt2d($subData, 6))) { $lr = '$' . $lr; } @@ -5581,18 +5580,18 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // not just return e.g. 'A1' and not 'A1:A1' ? // offset: 0; size: 2; first row - $frIndex = $this->_GetInt2d($subData, 0); // adjust below + $frIndex = self::_GetInt2d($subData, 0); // adjust below // offset: 2; size: 2; relative index to first row (0... 65535) should be treated as offset (-32768... 32767) - $lrIndex = $this->_GetInt2d($subData, 2); // adjust below + $lrIndex = self::_GetInt2d($subData, 2); // adjust below // offset: 4; size: 2; first column with relative/absolute flags // bit: 7-0; mask 0x00FF; column index - $fcIndex = 0x00FF & $this->_GetInt2d($subData, 4); + $fcIndex = 0x00FF & self::_GetInt2d($subData, 4); // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) - if (!(0x4000 & $this->_GetInt2d($subData, 4))) { + if (!(0x4000 & self::_GetInt2d($subData, 4))) { // absolute column index $fc = PHPExcel_Cell::stringFromColumnIndex($fcIndex); $fc = '$' . $fc; @@ -5603,7 +5602,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader } // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) - if (!(0x8000 & $this->_GetInt2d($subData, 4))) { + if (!(0x8000 & self::_GetInt2d($subData, 4))) { // absolute row index $fr = $frIndex + 1; $fr = '$' . $fr; @@ -5616,12 +5615,12 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 6; size: 2; last column with relative/absolute flags // bit: 7-0; mask 0x00FF; column index - $lcIndex = 0x00FF & $this->_GetInt2d($subData, 6); + $lcIndex = 0x00FF & self::_GetInt2d($subData, 6); $lcIndex = ($lcIndex <= 127) ? $lcIndex : $lcIndex - 256; $lc = PHPExcel_Cell::stringFromColumnIndex($baseCol + $lcIndex); // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) - if (!(0x4000 & $this->_GetInt2d($subData, 6))) { + if (!(0x4000 & self::_GetInt2d($subData, 6))) { // absolute column index $lc = PHPExcel_Cell::stringFromColumnIndex($lcIndex); $lc = '$' . $lc; @@ -5632,7 +5631,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader } // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) - if (!(0x8000 & $this->_GetInt2d($subData, 6))) { + if (!(0x8000 & self::_GetInt2d($subData, 6))) { // absolute row index $lr = $lrIndex + 1; $lr = '$' . $lr; @@ -5657,7 +5656,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $cellRangeAddresses = array(); // offset: 0; size: 2; number of the following cell range addresses - $nm = $this->_GetInt2d($subData, 0); + $nm = self::_GetInt2d($subData, 0); $offset = 2; // offset: 2; size: 8 * $nm; list of $nm (fixed) cell range addresses @@ -5684,7 +5683,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $cellRangeAddresses = array(); // offset: 0; size: 2; number of the following cell range addresses - $nm = $this->_GetInt2d($subData, 0); + $nm = self::_GetInt2d($subData, 0); $offset = 2; // offset: 2; size: 6 * $nm; list of $nm (fixed) cell range addresses @@ -5764,13 +5763,13 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param string $arrayData * @return array */ - private function _readBIFF8ConstantArray($arrayData) + private static function _readBIFF8ConstantArray($arrayData) { // offset: 0; size: 1; number of columns decreased by 1 $nc = ord($arrayData[0]); // offset: 1; size: 2; number of rows decreased by 1 - $nr = $this->_GetInt2d($arrayData, 1); + $nr = self::_GetInt2d($arrayData, 1); $size = 3; // initialize $arrayData = substr($arrayData, 3); @@ -5779,7 +5778,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader for ($r = 1; $r <= $nr + 1; ++$r) { $items = array(); for ($c = 1; $c <= $nc + 1; ++$c) { - $constant = $this->_readBIFF8Constant($arrayData); + $constant = self::_readBIFF8Constant($arrayData); $items[] = $constant['value']; $arrayData = substr($arrayData, $constant['size']); $size += $constant['size']; @@ -5802,7 +5801,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param string $valueData * @return array */ - private function _readBIFF8Constant($valueData) + private static function _readBIFF8Constant($valueData) { // offset: 0; size: 1; identifier for type of constant $identifier = ord($valueData[0]); @@ -5814,12 +5813,12 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; case 0x01: // number // offset: 1; size: 8; IEEE 754 floating-point value - $value = $this->_extractNumber(substr($valueData, 1, 8)); + $value = self::_extractNumber(substr($valueData, 1, 8)); $size = 9; break; case 0x02: // string value // offset: 1; size: var; Unicode string, 16-bit string length - $string = $this->_readUnicodeStringLong(substr($valueData, 1)); + $string = self::_readUnicodeStringLong(substr($valueData, 1)); $value = '"' . $string['value'] . '"'; $size = 1 + $string['size']; break; @@ -5834,7 +5833,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; case 0x10: // error code // offset: 1; size: 1; error code - $value = $this->_mapErrorCode(ord($valueData[1])); + $value = self::_mapErrorCode(ord($valueData[1])); $size = 9; break; } @@ -5851,7 +5850,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param string $rgb Encoded RGB value (4 bytes) * @return array */ - private function _readRGB($rgb) + private static function _readRGB($rgb) { // offset: 0; size 1; Red component $r = ord($rgb{0}); @@ -5899,7 +5898,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader private function _readByteStringLong($subData) { // offset: 0; size: 2; length of the string (character count) - $ln = $this->_GetInt2d($subData, 0); + $ln = self::_GetInt2d($subData, 0); // offset: 2: size: var; character array (8-bit characters) $value = $this->_decodeCodepage(substr($subData, 2)); @@ -5919,14 +5918,14 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param string $subData * @return array */ - private function _readUnicodeStringShort($subData) + private static function _readUnicodeStringShort($subData) { $value = ''; // offset: 0: size: 1; length of the string (character count) $characterCount = ord($subData[0]); - $string = $this->_readUnicodeString(substr($subData, 1), $characterCount); + $string = self::_readUnicodeString(substr($subData, 1), $characterCount); // add 1 for the string length $string['size'] += 1; @@ -5942,14 +5941,14 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param string $subData * @return array */ - private function _readUnicodeStringLong($subData) + private static function _readUnicodeStringLong($subData) { $value = ''; // offset: 0: size: 2; length of the string (character count) - $characterCount = $this->_GetInt2d($subData, 0); + $characterCount = self::_GetInt2d($subData, 0); - $string = $this->_readUnicodeString(substr($subData, 2), $characterCount); + $string = self::_readUnicodeString(substr($subData, 2), $characterCount); // add 2 for the string length $string['size'] += 2; @@ -5966,7 +5965,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param int $characterCount * @return array */ - private function _readUnicodeString($subData, $characterCount) + private static function _readUnicodeString($subData, $characterCount) { $value = ''; @@ -5984,7 +5983,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 1: size: var; character array // this offset assumes richtext and Asian phonetic settings are off which is generally wrong // needs to be fixed - $value = $this->_encodeUTF16(substr($subData, 1, $isCompressed ? $characterCount : 2 * $characterCount), $isCompressed); + $value = self::_encodeUTF16(substr($subData, 1, $isCompressed ? $characterCount : 2 * $characterCount), $isCompressed); return array( 'value' => $value, @@ -5999,7 +5998,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param string $value UTF-8 encoded string * @return string */ - private function _UTF8toExcelDoubleQuoted($value) + private static function _UTF8toExcelDoubleQuoted($value) { return '"' . str_replace('"', '""', $value) . '"'; } @@ -6010,10 +6009,10 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param string $data Binary string that is at least 8 bytes long * @return float */ - private function _extractNumber($data) + private static function _extractNumber($data) { - $rknumhigh = $this->_GetInt4d($data, 4); - $rknumlow = $this->_GetInt4d($data, 0); + $rknumhigh = self::_GetInt4d($data, 4); + $rknumlow = self::_GetInt4d($data, 0); $sign = ($rknumhigh & 0x80000000) >> 31; $exp = (($rknumhigh & 0x7ff00000) >> 20) - 1023; $mantissa = (0x100000 | ($rknumhigh & 0x000fffff)); @@ -6033,7 +6032,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader return $value; } - private function _GetIEEE754($rknum) + private static function _GetIEEE754($rknum) { if (($rknum & 0x02) != 0) { $value = $rknum >> 2; @@ -6066,10 +6065,10 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param bool $compressed * @return string */ - private function _encodeUTF16($string, $compressed = '') + private static function _encodeUTF16($string, $compressed = '') { if ($compressed) { - $string = $this->_uncompressByteString($string); + $string = self::_uncompressByteString($string); } return PHPExcel_Shared_String::ConvertEncoding($string, 'UTF-8', 'UTF-16LE'); @@ -6081,7 +6080,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param string $string * @return string */ - private function _uncompressByteString($string) + private static function _uncompressByteString($string) { $uncompressedString = ''; $strLen = strlen($string); @@ -6110,7 +6109,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param int $pos * @return int */ - private function _GetInt2d($data, $pos) + private static function _GetInt2d($data, $pos) { return ord($data[$pos]) | (ord($data[$pos + 1]) << 8); } @@ -6122,7 +6121,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param int $pos * @return int */ - private function _GetInt4d($data, $pos) + private static function _GetInt4d($data, $pos) { //return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | // (ord($data[$pos + 2]) << 16) | (ord($data[$pos + 3]) << 24); @@ -6149,17 +6148,17 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader { if ($color <= 0x07 || $color >= 0x40) { // special built-in color - return $this->_mapBuiltInColor($color); + return self::_mapBuiltInColor($color); } else if (isset($this->_palette) && isset($this->_palette[$color - 8])) { // palette color, color index 0x08 maps to pallete index 0 return $this->_palette[$color - 8]; } else { // default color table if ($this->_version == self::XLS_BIFF8) { - return $this->_mapColor($color); + return self::_mapColor($color); } else { // BIFF5 - return $this->_mapColorBIFF5($color); + return self::_mapColorBIFF5($color); } } @@ -6174,7 +6173,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param int $index * @return string */ - private function _mapBorderStyle($index) + private static function _mapBorderStyle($index) { switch ($index) { case 0x00: return PHPExcel_Style_Border::BORDER_NONE; @@ -6202,7 +6201,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param int $index * @return string */ - private function _mapFillPattern($index) + private static function _mapFillPattern($index) { switch ($index) { case 0x00: return PHPExcel_Style_Fill::FILL_NONE; @@ -6234,7 +6233,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param int $subData * @return string */ - private function _mapErrorCode($subData) + private static function _mapErrorCode($subData) { switch ($subData) { case 0x00: return '#NULL!'; break; @@ -6254,7 +6253,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param int $color Indexed color * @return array */ - private function _mapBuiltInColor($color) + private static function _mapBuiltInColor($color) { switch ($color) { case 0x00: return array('rgb' => '000000'); @@ -6277,7 +6276,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param int $subData * @return array */ - private function _mapColorBIFF5($subData) + private static function _mapColorBIFF5($subData) { switch ($subData) { case 0x08: return array('rgb' => '000000'); @@ -6346,7 +6345,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader * @param int $subData * @return array */ - private function _mapColor($subData) + private static function _mapColor($subData) { switch ($subData) { case 0x08: return array('rgb' => '000000'); diff --git a/Classes/PHPExcel/Reader/Excel5/Escher.php b/Classes/PHPExcel/Reader/Excel5/Escher.php index c25ae5b..917598c 100644 --- a/Classes/PHPExcel/Reader/Excel5/Escher.php +++ b/Classes/PHPExcel/Reader/Excel5/Escher.php @@ -108,9 +108,8 @@ class PHPExcel_Reader_Excel5_Escher // Parse Escher stream while ($this->_pos < $this->_dataSize) { - // offset: 2; size: 2: Record Type - $fbt = $this->_GetInt2d($this->_data, $this->_pos + 2); + $fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos + 2); switch ($fbt) { case self::DGGCONTAINER: $this->_readDggContainer(); break; @@ -144,15 +143,15 @@ class PHPExcel_Reader_Excel5_Escher private function _readDefault() { // offset 0; size: 2; recVer and recInstance - $verInstance = $this->_GetInt2d($this->_data, $this->_pos); + $verInstance = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos); // offset: 2; size: 2: Record Type - $fbt = $this->_GetInt2d($this->_data, $this->_pos + 2); + $fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos + 2); // bit: 0-3; mask: 0x000F; recVer $recVer = (0x000F & $verInstance) >> 0; - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -164,7 +163,7 @@ class PHPExcel_Reader_Excel5_Escher */ private function _readDggContainer() { - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -182,7 +181,7 @@ class PHPExcel_Reader_Excel5_Escher */ private function _readDgg() { - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -194,7 +193,7 @@ class PHPExcel_Reader_Excel5_Escher */ private function _readBstoreContainer() { - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -215,9 +214,9 @@ class PHPExcel_Reader_Excel5_Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & $this->_GetInt2d($this->_data, $this->_pos)) >> 4; + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -239,16 +238,16 @@ class PHPExcel_Reader_Excel5_Escher $rgbUid = substr($recordData, 2, 16); // offset: 18; size: 2; tag - $tag = $this->_GetInt2d($recordData, 18); + $tag = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 18); // offset: 20; size: 4; size of BLIP in bytes - $size = $this->_GetInt4d($recordData, 20); + $size = PHPExcel_Reader_Excel5::_GetInt4d($recordData, 20); // offset: 24; size: 4; number of references to this BLIP - $cRef = $this->_GetInt4d($recordData, 24); + $cRef = PHPExcel_Reader_Excel5::_GetInt4d($recordData, 24); // offset: 28; size: 4; MSOFO file offset - $foDelay = $this->_GetInt4d($recordData, 28); + $foDelay = PHPExcel_Reader_Excel5::_GetInt4d($recordData, 28); // offset: 32; size: 1; unused1 $unused1 = ord($recordData{32}); @@ -281,9 +280,9 @@ class PHPExcel_Reader_Excel5_Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & $this->_GetInt2d($this->_data, $this->_pos)) >> 4; + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -322,9 +321,9 @@ class PHPExcel_Reader_Excel5_Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & $this->_GetInt2d($this->_data, $this->_pos)) >> 4; + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -363,9 +362,9 @@ class PHPExcel_Reader_Excel5_Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & $this->_GetInt2d($this->_data, $this->_pos)) >> 4; + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -382,9 +381,9 @@ class PHPExcel_Reader_Excel5_Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & $this->_GetInt2d($this->_data, $this->_pos)) >> 4; + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -396,7 +395,7 @@ class PHPExcel_Reader_Excel5_Escher */ private function _readSplitMenuColors() { - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -408,7 +407,7 @@ class PHPExcel_Reader_Excel5_Escher */ private function _readDgContainer() { - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -426,7 +425,7 @@ class PHPExcel_Reader_Excel5_Escher */ private function _readDg() { - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -440,7 +439,7 @@ class PHPExcel_Reader_Excel5_Escher { // context is either context DgContainer or SpgrContainer - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -466,7 +465,7 @@ class PHPExcel_Reader_Excel5_Escher */ private function _readSpContainer() { - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // add spContainer to spgrContainer @@ -486,7 +485,7 @@ class PHPExcel_Reader_Excel5_Escher */ private function _readSpgr() { - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -501,9 +500,9 @@ class PHPExcel_Reader_Excel5_Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & $this->_GetInt2d($this->_data, $this->_pos)) >> 4; + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -518,9 +517,9 @@ class PHPExcel_Reader_Excel5_Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & $this->_GetInt2d($this->_data, $this->_pos)) >> 4; + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -532,35 +531,35 @@ class PHPExcel_Reader_Excel5_Escher */ private function _readClientAnchor() { - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record $this->_pos += 8 + $length; // offset: 2; size: 2; upper-left corner column index (0-based) - $c1 = $this->_GetInt2d($recordData, 2); + $c1 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 2); // offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width - $startOffsetX = $this->_GetInt2d($recordData, 4); + $startOffsetX = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 4); // offset: 6; size: 2; upper-left corner row index (0-based) - $r1 = $this->_GetInt2d($recordData, 6); + $r1 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 6); // offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height - $startOffsetY = $this->_GetInt2d($recordData, 8); + $startOffsetY = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 8); // offset: 10; size: 2; bottom-right corner column index (0-based) - $c2 = $this->_GetInt2d($recordData, 10); + $c2 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 10); // offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width - $endOffsetX = $this->_GetInt2d($recordData, 12); + $endOffsetX = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 12); // offset: 14; size: 2; bottom-right corner row index (0-based) - $r2 = $this->_GetInt2d($recordData, 14); + $r2 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 14); // offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height - $endOffsetY = $this->_GetInt2d($recordData, 16); + $endOffsetY = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 16); // set the start coordinates $this->_object->setStartCoordinates(PHPExcel_Cell::stringFromColumnIndex($c1) . ($r1 + 1)); @@ -586,7 +585,7 @@ class PHPExcel_Reader_Excel5_Escher */ private function _readClientData() { - $length = $this->_GetInt4d($this->_data, $this->_pos + 4); + $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $recordData = substr($this->_data, $this->_pos + 8, $length); // move stream pointer to next record @@ -609,7 +608,7 @@ class PHPExcel_Reader_Excel5_Escher $fopte = substr($data, 6 * $i, 6); // offset: 0; size: 2; opid - $opid = $this->_GetInt2d($fopte, 0); + $opid = PHPExcel_Reader_Excel5::_GetInt2d($fopte, 0); // bit: 0-13; mask: 0x3FFF; opid.opid $opidOpid = (0x3FFF & $opid) >> 0; @@ -621,7 +620,7 @@ class PHPExcel_Reader_Excel5_Escher $opidFComplex = (0x8000 & $opid) >> 15; // offset: 2; size: 4; the value for this property - $op = $this->_GetInt4d($fopte, 2); + $op = PHPExcel_Reader_Excel5::_GetInt4d($fopte, 2); if ($opidFComplex) { $complexData = substr($splicedComplexData, 0, $op); @@ -638,40 +637,4 @@ class PHPExcel_Reader_Excel5_Escher } } - /** - * Read 16-bit unsigned integer - * - * @param string $data - * @param int $pos - * @return int - */ - private function _GetInt2d($data, $pos) - { - return ord($data[$pos]) | (ord($data[$pos + 1]) << 8); - } - - /** - * Read 32-bit signed integer - * - * @param string $data - * @param int $pos - * @return int - */ - private function _GetInt4d($data, $pos) - { - //return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | - // (ord($data[$pos + 2]) << 16) | (ord($data[$pos + 3]) << 24); - - // FIX: represent numbers correctly on 64-bit system - // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 - $_or_24 = ord($data[$pos + 3]); - if ($_or_24 >= 128) { - // negative number - $_ord_24 = -abs((256 - $_or_24) << 24); - } else { - $_ord_24 = ($_or_24 & 127) << 24; - } - return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | (ord($data[$pos + 2]) << 16) | $_ord_24; - } - }