You are here

function PHPExcel_Writer_Excel5_Parser::_convertRange3d 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::_convertRange3d()

* Convert an Excel 3d range such as "Sheet1!A1:D4" or "Sheet1:Sheet2!A1:D4" to * a ptgArea3d. * * @access private *

Parameters

string $token An Excel range in the Sheet1!A1:A2 format.: * @return mixed The packed ptgArea3d token on success.

1 call to PHPExcel_Writer_Excel5_Parser::_convertRange3d()
PHPExcel_Writer_Excel5_Parser::_convert in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Parser.php
* Convert a token to the proper ptg value. * * @access private *

File

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

Class

PHPExcel_Writer_Excel5_Parser
PHPExcel_Writer_Excel5_Parser

Code

function _convertRange3d($token) {

  //		$class = 0; // formulas like Sheet1!$A$1:$A$2 in list type data validation need this class (0x3B)
  // Split the ref at the ! symbol
  list($ext_ref, $range) = explode('!', $token);

  // Convert the external reference part (different for BIFF8)
  $ext_ref = $this
    ->_getRefIndex($ext_ref);

  // Split the range into 2 cell refs
  list($cell1, $cell2) = explode(':', $range);

  // Convert the cell references
  if (preg_match("/^(\\\$)?[A-Ia-i]?[A-Za-z](\\\$)?(\\d+)\$/", $cell1)) {
    list($row1, $col1) = $this
      ->_cellToPackedRowcol($cell1);
    list($row2, $col2) = $this
      ->_cellToPackedRowcol($cell2);
  }
  else {

    // It's a rows range (like 26:27)
    list($row1, $col1, $row2, $col2) = $this
      ->_rangeToPackedRange($cell1 . ':' . $cell2);
  }

  // The ptg value depends on the class of the ptg.
  //		if ($class == 0) {
  $ptgArea = pack("C", $this->ptg['ptgArea3d']);

  //		} elseif ($class == 1) {
  //			$ptgArea = pack("C", $this->ptg['ptgArea3dV']);
  //		} elseif ($class == 2) {
  //			$ptgArea = pack("C", $this->ptg['ptgArea3dA']);
  //		} else {
  //			throw new PHPExcel_Writer_Exception("Unknown class $class");
  //		}
  return $ptgArea . $ext_ref . $row1 . $row2 . $col1 . $col2;
}