You are here

function PHPExcel_Writer_Excel5_Parser::_cellToPackedRowcol in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Parser.php \PHPExcel_Writer_Excel5_Parser::_cellToPackedRowcol()

* pack() row and column into the required 3 or 4 byte format. * * @access private *

Parameters

string $cell The Excel cell reference to be packed: * @return array Array containing the row and column in packed() format

4 calls to PHPExcel_Writer_Excel5_Parser::_cellToPackedRowcol()
PHPExcel_Writer_Excel5_Parser::_convertRange2d in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Parser.php
* Convert an Excel range such as A1:D4 to a ptgRefV. * * @access private *
PHPExcel_Writer_Excel5_Parser::_convertRange3d in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Parser.php
* Convert an Excel 3d range such as "Sheet1!A1:D4" or "Sheet1:Sheet2!A1:D4" to * a ptgArea3d. * * @access private *
PHPExcel_Writer_Excel5_Parser::_convertRef2d in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Parser.php
* Convert an Excel reference such as A1, $B2, C$3 or $D$4 to a ptgRefV. * * @access private *
PHPExcel_Writer_Excel5_Parser::_convertRef3d in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Parser.php
* Convert an Excel 3d reference such as "Sheet1!A1" or "Sheet1:Sheet2!A1" to a * ptgRef3d. * * @access private *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Parser.php, line 940

Class

PHPExcel_Writer_Excel5_Parser
PHPExcel_Writer_Excel5_Parser

Code

function _cellToPackedRowcol($cell) {
  $cell = strtoupper($cell);
  list($row, $col, $row_rel, $col_rel) = $this
    ->_cellToRowcol($cell);
  if ($col >= 256) {
    throw new PHPExcel_Writer_Exception("Column in: {$cell} greater than 255");
  }
  if ($row >= 65536) {
    throw new PHPExcel_Writer_Exception("Row in: {$cell} greater than 65536 ");
  }

  // Set the high bits to indicate if row or col are relative.
  $col |= $col_rel << 14;
  $col |= $row_rel << 15;
  $col = pack('v', $col);
  $row = pack('v', $row);
  return array(
    $row,
    $col,
  );
}