You are here

private static function PHPExcel_ReferenceHelper::cellAddressInDeleteRange 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::cellAddressInDeleteRange()

* Test whether a cell address falls within a defined range of cells * *

Parameters

string $cellAddress Address of the cell we're testing: * @param integer $beforeRow Number of the row we're inserting/deleting before * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) * @return boolean

2 calls to PHPExcel_ReferenceHelper::cellAddressInDeleteRange()
PHPExcel_ReferenceHelper::_adjustComments in vendor/phpoffice/phpexcel/Classes/PHPExcel/ReferenceHelper.php
* Update cell comments when inserting/deleting rows/columns * *
PHPExcel_ReferenceHelper::_adjustPageBreaks in vendor/phpoffice/phpexcel/Classes/PHPExcel/ReferenceHelper.php
* Update page breaks when inserting/deleting rows/columns * *

File

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

Class

PHPExcel_ReferenceHelper
PHPExcel_ReferenceHelper (Singleton)

Code

private static function cellAddressInDeleteRange($cellAddress, $beforeRow, $pNumRows, $beforeColumnIndex, $pNumCols) {
  list($cellColumn, $cellRow) = PHPExcel_Cell::coordinateFromString($cellAddress);
  $cellColumnIndex = PHPExcel_Cell::columnIndexFromString($cellColumn);

  //	Is cell within the range of rows/columns if we're deleting
  if ($pNumRows < 0 && $cellRow >= $beforeRow + $pNumRows && $cellRow < $beforeRow) {
    return TRUE;
  }
  elseif ($pNumCols < 0 && $cellColumnIndex >= $beforeColumnIndex + $pNumCols && $cellColumnIndex < $beforeColumnIndex) {
    return TRUE;
  }
  return FALSE;
}