You are here

public static function PHPExcel_Cell::rangeBoundaries in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php \PHPExcel_Cell::rangeBoundaries()

* Calculate range boundaries * *

Parameters

string $pRange Cell range (e.g. A1:A1): * @return array Range coordinates array(Start Cell, End Cell) * where Start Cell and End Cell are arrays (Column Number, Row Number)

13 calls to PHPExcel_Cell::rangeBoundaries()
PHPExcel_Cell::isInRange in vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php
* Is cell in a specific range? * *
PHPExcel_Cell::rangeDimension in vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php
* Calculate range dimension * *
PHPExcel_ReferenceHelper::insertNewBefore in vendor/phpoffice/phpexcel/Classes/PHPExcel/ReferenceHelper.php
* Insert a new column or row, updating all possible related data * *
PHPExcel_Worksheet::duplicateConditionalStyle in vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php
Duplicate conditional style to a range of cells
PHPExcel_Worksheet::duplicateStyle in vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php
Duplicate cell style to a range of cells

... See full list

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php, line 707

Class

PHPExcel_Cell
PHPExcel_Cell

Code

public static function rangeBoundaries($pRange = 'A1:A1') {

  // Ensure $pRange is a valid range
  if (empty($pRange)) {
    $pRange = self::DEFAULT_RANGE;
  }

  // Uppercase coordinate
  $pRange = strtoupper($pRange);

  // Extract range
  if (strpos($pRange, ':') === FALSE) {
    $rangeA = $rangeB = $pRange;
  }
  else {
    list($rangeA, $rangeB) = explode(':', $pRange);
  }

  // Calculate range outer borders
  $rangeStart = self::coordinateFromString($rangeA);
  $rangeEnd = self::coordinateFromString($rangeB);

  // Translate column into index
  $rangeStart[0] = self::columnIndexFromString($rangeStart[0]);
  $rangeEnd[0] = self::columnIndexFromString($rangeEnd[0]);
  return array(
    $rangeStart,
    $rangeEnd,
  );
}