You are here

private function PHPExcel_Shared_OLERead::_readPropertySets in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLERead.php \PHPExcel_Shared_OLERead::_readPropertySets()

* Read entries in the directory stream.

1 call to PHPExcel_Shared_OLERead::_readPropertySets()
PHPExcel_Shared_OLERead::read in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLERead.php
* Read the file * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLERead.php, line 236

Class

PHPExcel_Shared_OLERead

Code

private function _readPropertySets() {
  $offset = 0;

  // loop through entires, each entry is 128 bytes
  $entryLen = strlen($this->entry);
  while ($offset < $entryLen) {

    // entry data (128 bytes)
    $d = substr($this->entry, $offset, self::PROPERTY_STORAGE_BLOCK_SIZE);

    // size in bytes of name
    $nameSize = ord($d[self::SIZE_OF_NAME_POS]) | ord($d[self::SIZE_OF_NAME_POS + 1]) << 8;

    // type of entry
    $type = ord($d[self::TYPE_POS]);

    // sectorID of first sector or short sector, if this entry refers to a stream (the case with workbook)
    // sectorID of first sector of the short-stream container stream, if this entry is root entry
    $startBlock = self::_GetInt4d($d, self::START_BLOCK_POS);
    $size = self::_GetInt4d($d, self::SIZE_POS);
    $name = str_replace("\0", "", substr($d, 0, $nameSize));
    $this->props[] = array(
      'name' => $name,
      'type' => $type,
      'startBlock' => $startBlock,
      'size' => $size,
    );

    // tmp helper to simplify checks
    $upName = strtoupper($name);

    // Workbook directory entry (BIFF5 uses Book, BIFF8 uses Workbook)
    if ($upName === 'WORKBOOK' || $upName === 'BOOK') {
      $this->wrkbook = count($this->props) - 1;
    }
    else {
      if ($upName === 'ROOT ENTRY' || $upName === 'R') {

        // Root entry
        $this->rootentry = count($this->props) - 1;
      }
    }

    // Summary information
    if ($name == chr(5) . 'SummaryInformation') {

      //				echo 'Summary Information<br />';
      $this->summaryInformation = count($this->props) - 1;
    }

    // Additional Document Summary information
    if ($name == chr(5) . 'DocumentSummaryInformation') {

      //				echo 'Document Summary Information<br />';
      $this->documentSummaryInformation = count($this->props) - 1;
    }
    $offset += self::PROPERTY_STORAGE_BLOCK_SIZE;
  }
}