You are here

private function PHPExcel_Reader_Excel5::_readRow in Loft Data Grids 6.2

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

* ROW * * This record contains the properties of a single row in a * sheet. Rows and cells in a sheet are divided into blocks * of 32 rows. * * -- "OpenOffice.org's Documentation of the Microsoft * Excel File Format"

1 call to PHPExcel_Reader_Excel5::_readRow()
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 3501

Class

PHPExcel_Reader_Excel5
PHPExcel_Reader_Excel5

Code

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

  // move stream pointer to next record
  $this->_pos += 4 + $length;
  if (!$this->_readDataOnly) {

    // offset: 0; size: 2; index of this row
    $r = self::_GetInt2d($recordData, 0);

    // offset: 2; size: 2; index to column of the first cell which is described by a cell record
    // offset: 4; size: 2; index to column of the last cell which is described by a cell record, increased by 1
    // offset: 6; size: 2;
    // bit: 14-0; mask: 0x7FFF; height of the row, in twips = 1/20 of a point
    $height = (0x7fff & self::_GetInt2d($recordData, 6)) >> 0;

    // bit: 15: mask: 0x8000; 0 = row has custom height; 1= row has default height
    $useDefaultHeight = (0x8000 & self::_GetInt2d($recordData, 6)) >> 15;
    if (!$useDefaultHeight) {
      $this->_phpSheet
        ->getRowDimension($r + 1)
        ->setRowHeight($height / 20);
    }

    // offset: 8; size: 2; not used
    // offset: 10; size: 2; not used in BIFF5-BIFF8
    // offset: 12; size: 4; option flags and default row formatting
    // bit: 2-0: mask: 0x00000007; outline level of the row
    $level = (0x7 & 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 = (0x10 & self::_GetInt4d($recordData, 12)) >> 4;
    $this->_phpSheet
      ->getRowDimension($r + 1)
      ->setCollapsed($isCollapsed);

    // bit: 5; mask: 0x00000020; 1 = row is hidden
    $isHidden = (0x20 & self::_GetInt4d($recordData, 12)) >> 5;
    $this->_phpSheet
      ->getRowDimension($r + 1)
      ->setVisible(!$isHidden);

    // bit: 7; mask: 0x00000080; 1 = row has explicit format
    $hasExplicitFormat = (0x80 & self::_GetInt4d($recordData, 12)) >> 7;

    // bit: 27-16; mask: 0x0FFF0000; only applies when hasExplicitFormat = 1; index to XF record
    $xfIndex = (0xfff0000 & self::_GetInt4d($recordData, 12)) >> 16;
    if ($hasExplicitFormat) {
      $this->_phpSheet
        ->getRowDimension($r + 1)
        ->setXfIndex($this->_mapCellXfIndex[$xfIndex]);
    }
  }
}