You are here

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

* Read MULRK record * This record represents a cell range containing RK value * cells. All cells are located in the same row. * * -- "OpenOffice.org's Documentation of the Microsoft * Excel File Format"

1 call to PHPExcel_Reader_Excel5::_readMulRk()
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 3694

Class

PHPExcel_Reader_Excel5
PHPExcel_Reader_Excel5

Code

private function _readMulRk() {
  $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;

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

  // offset: 2; size: 2; index to first column
  $colFirst = self::_GetInt2d($recordData, 2);

  // offset: var; size: 2; index to last column
  $colLast = self::_GetInt2d($recordData, $length - 2);
  $columns = $colLast - $colFirst + 1;

  // offset within record data
  $offset = 4;
  for ($i = 0; $i < $columns; ++$i) {
    $columnString = PHPExcel_Cell::stringFromColumnIndex($colFirst + $i);

    // Read cell?
    if ($this
      ->getReadFilter() !== NULL && $this
      ->getReadFilter()
      ->readCell($columnString, $row + 1, $this->_phpSheet
      ->getTitle())) {

      // offset: var; size: 2; index to XF record
      $xfIndex = self::_GetInt2d($recordData, $offset);

      // offset: var; size: 4; RK value
      $numValue = self::_GetIEEE754(self::_GetInt4d($recordData, $offset + 2));
      $cell = $this->_phpSheet
        ->getCell($columnString . ($row + 1));
      if (!$this->_readDataOnly) {

        // add style
        $cell
          ->setXfIndex($this->_mapCellXfIndex[$xfIndex]);
      }

      // add cell value
      $cell
        ->setValueExplicit($numValue, PHPExcel_Cell_DataType::TYPE_NUMERIC);
    }
    $offset += 6;
  }
}