You are here

public function PHPExcel_ReferenceHelper::updateCellReference in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/ReferenceHelper.php \PHPExcel_ReferenceHelper::updateCellReference()

* Update cell reference * *

Parameters

string $pCellRange Cell range: * @param int $pBefore Insert before this one * @param int $pNumCols Number of columns to increment * @param int $pNumRows Number of rows to increment * @return string Updated cell range * @throws PHPExcel_Exception

10 calls to PHPExcel_ReferenceHelper::updateCellReference()
PHPExcel_ReferenceHelper::insertNewBefore in vendor/phpoffice/phpexcel/Classes/PHPExcel/ReferenceHelper.php
* Insert a new column or row, updating all possible related data * *
PHPExcel_ReferenceHelper::updateFormulaReferences in vendor/phpoffice/phpexcel/Classes/PHPExcel/ReferenceHelper.php
* Update references within formulas * *
PHPExcel_ReferenceHelper::_adjustColumnDimensions in vendor/phpoffice/phpexcel/Classes/PHPExcel/ReferenceHelper.php
* Update column dimensions when inserting/deleting rows/columns * *
PHPExcel_ReferenceHelper::_adjustComments in vendor/phpoffice/phpexcel/Classes/PHPExcel/ReferenceHelper.php
* Update cell comments when inserting/deleting rows/columns * *
PHPExcel_ReferenceHelper::_adjustDataValidations in vendor/phpoffice/phpexcel/Classes/PHPExcel/ReferenceHelper.php
* Update data validations when inserting/deleting rows/columns * *

... See full list

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/ReferenceHelper.php, line 792

Class

PHPExcel_ReferenceHelper
PHPExcel_ReferenceHelper (Singleton)

Code

public function updateCellReference($pCellRange = 'A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0) {

  // Is it in another worksheet? Will not have to update anything.
  if (strpos($pCellRange, "!") !== false) {
    return $pCellRange;

    // Is it a range or a single cell?
  }
  elseif (strpos($pCellRange, ':') === false && strpos($pCellRange, ',') === false) {

    // Single cell
    return $this
      ->_updateSingleCellReference($pCellRange, $pBefore, $pNumCols, $pNumRows);
  }
  elseif (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) {

    // Range
    return $this
      ->_updateCellRange($pCellRange, $pBefore, $pNumCols, $pNumRows);
  }
  else {

    // Return original
    return $pCellRange;
  }
}