You are here

protected function PHPExcel_Worksheet_ColumnCellIterator::adjustForExistingOnlyRange in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet/ColumnCellIterator.php \PHPExcel_Worksheet_ColumnCellIterator::adjustForExistingOnlyRange()

* Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary *

Throws

PHPExcel_Exception

Overrides PHPExcel_Worksheet_CellIterator::adjustForExistingOnlyRange

2 calls to PHPExcel_Worksheet_ColumnCellIterator::adjustForExistingOnlyRange()
PHPExcel_Worksheet_ColumnCellIterator::resetEnd in vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet/ColumnCellIterator.php
* (Re)Set the end row * *
PHPExcel_Worksheet_ColumnCellIterator::resetStart in vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet/ColumnCellIterator.php
* (Re)Set the start row and the current row pointer * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet/ColumnCellIterator.php, line 196

Class

PHPExcel_Worksheet_ColumnCellIterator
PHPExcel_Worksheet_ColumnCellIterator

Code

protected function adjustForExistingOnlyRange() {
  if ($this->_onlyExistingCells) {
    while (!$this->_subject
      ->cellExistsByColumnAndRow($this->_columnIndex, $this->_startRow) && $this->_startRow <= $this->_endRow) {
      ++$this->_startRow;
    }
    if ($this->_startRow > $this->_endRow) {
      throw new PHPExcel_Exception('No cells exist within the specified range');
    }
    while (!$this->_subject
      ->cellExistsByColumnAndRow($this->_columnIndex, $this->_endRow) && $this->_endRow >= $this->_startRow) {
      --$this->_endRow;
    }
    if ($this->_endRow < $this->_startRow) {
      throw new PHPExcel_Exception('No cells exist within the specified range');
    }
  }
}