You are here

private function PHPExcel_Reader_Excel5::_readColInfo 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::_readColInfo()

* Read COLINFO record

1 call to PHPExcel_Reader_Excel5::_readColInfo()
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 3442

Class

PHPExcel_Reader_Excel5
PHPExcel_Reader_Excel5

Code

private function _readColInfo() {
  $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 to first column in range
    $fc = self::_GetInt2d($recordData, 0);

    // first column index
    // offset: 2; size: 2; index to last column in range
    $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 = self::_GetInt2d($recordData, 4);

    // offset: 6; size: 2; index to XF record for default column formatting
    $xfIndex = self::_GetInt2d($recordData, 6);

    // offset: 8; size: 2; option flags
    // bit: 0; mask: 0x0001; 1= columns are hidden
    $isHidden = (0x1 & self::_GetInt2d($recordData, 8)) >> 0;

    // bit: 10-8; mask: 0x0700; outline level of the columns (0 = no outline)
    $level = (0x700 & self::_GetInt2d($recordData, 8)) >> 8;

    // bit: 12; mask: 0x1000; 1 = collapsed
    $isCollapsed = (0x1000 & self::_GetInt2d($recordData, 8)) >> 12;

    // offset: 10; size: 2; not used
    for ($i = $fc; $i <= $lc; ++$i) {
      if ($lc == 255 || $lc == 256) {
        $this->_phpSheet
          ->getDefaultColumnDimension()
          ->setWidth($width / 256);
        break;
      }
      $this->_phpSheet
        ->getColumnDimensionByColumn($i)
        ->setWidth($width / 256);
      $this->_phpSheet
        ->getColumnDimensionByColumn($i)
        ->setVisible(!$isHidden);
      $this->_phpSheet
        ->getColumnDimensionByColumn($i)
        ->setOutlineLevel($level);
      $this->_phpSheet
        ->getColumnDimensionByColumn($i)
        ->setCollapsed($isCollapsed);
      $this->_phpSheet
        ->getColumnDimensionByColumn($i)
        ->setXfIndex($this->_mapCellXfIndex[$xfIndex]);
    }
  }
}