You are here

private function PHPExcel_Reader_Excel5::_readSheet in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php \PHPExcel_Reader_Excel5::_readSheet()

* SHEET * * This record is located in the Workbook Globals * Substream and represents a sheet inside the workbook. * One SHEET record is written for each sheet. It stores the * sheet name and a stream offset to the BOF record of the * respective Sheet Substream within the Workbook Stream. * * -- "OpenOffice.org's Documentation of the Microsoft * Excel File Format"

3 calls to PHPExcel_Reader_Excel5::_readSheet()
PHPExcel_Reader_Excel5::listWorksheetInfo in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) * *
PHPExcel_Reader_Excel5::listWorksheetNames in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object * *
PHPExcel_Reader_Excel5::load in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Loads PHPExcel from file * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php, line 2545

Class

PHPExcel_Reader_Excel5
PHPExcel_Reader_Excel5

Code

private function _readSheet() {
  $length = self::_GetInt2d($this->_data, $this->_pos + 2);
  $recordData = $this
    ->_readRecordData($this->_data, $this->_pos + 4, $length);

  // offset: 0; size: 4; absolute stream position of the BOF record of the sheet
  // NOTE: not encrypted
  $rec_offset = self::_GetInt4d($this->_data, $this->_pos + 4);

  // move stream pointer to next record
  $this->_pos += 4 + $length;

  // offset: 4; size: 1; sheet state
  switch (ord($recordData[4])) {
    case 0x0:
      $sheetState = PHPExcel_Worksheet::SHEETSTATE_VISIBLE;
      break;
    case 0x1:
      $sheetState = PHPExcel_Worksheet::SHEETSTATE_HIDDEN;
      break;
    case 0x2:
      $sheetState = PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN;
      break;
    default:
      $sheetState = PHPExcel_Worksheet::SHEETSTATE_VISIBLE;
      break;
  }

  // offset: 5; size: 1; sheet type
  $sheetType = ord($recordData[5]);

  // offset: 6; size: var; sheet name
  if ($this->_version == self::XLS_BIFF8) {
    $string = self::_readUnicodeStringShort(substr($recordData, 6));
    $rec_name = $string['value'];
  }
  elseif ($this->_version == self::XLS_BIFF7) {
    $string = $this
      ->_readByteStringShort(substr($recordData, 6));
    $rec_name = $string['value'];
  }
  $this->_sheets[] = array(
    'name' => $rec_name,
    'offset' => $rec_offset,
    'sheetState' => $sheetState,
    'sheetType' => $sheetType,
  );
}