mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-26 07:16:03 +03:00
Merge branch 'develop' of https://github.com/PHPOffice/PHPExcel into develop
This commit is contained in:
commit
4baab36319
@ -461,10 +461,12 @@ class PHPExcel
|
||||
* Get active sheet
|
||||
*
|
||||
* @return PHPExcel_Worksheet
|
||||
*
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function getActiveSheet()
|
||||
{
|
||||
return $this->_workSheetCollection[$this->_activeSheetIndex];
|
||||
return $this->getSheet($this->_activeSheetIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -570,16 +572,14 @@ class PHPExcel
|
||||
*/
|
||||
public function getSheet($pIndex = 0)
|
||||
{
|
||||
|
||||
$numSheets = count($this->_workSheetCollection);
|
||||
|
||||
if ($pIndex > $numSheets - 1) {
|
||||
if (!isset($this->_workSheetCollection[$pIndex])) {
|
||||
$numSheets = $this->getSheetCount();
|
||||
throw new PHPExcel_Exception(
|
||||
"Your requested sheet index: {$pIndex} is out of bounds. The actual number of sheets is {$numSheets}."
|
||||
);
|
||||
} else {
|
||||
return $this->_workSheetCollection[$pIndex];
|
||||
}
|
||||
|
||||
return $this->_workSheetCollection[$pIndex];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user