mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-22 13:26:07 +03:00
Still improving the out of bounds error messages in the exceptions.
This commit is contained in:
parent
9926c64314
commit
aadc933827
@ -267,7 +267,7 @@ class PHPExcel
|
||||
|
||||
if ($pIndex > count($this->_workSheetCollection) - 1) {
|
||||
throw new PHPExcel_Exception(
|
||||
"The requested Sheet index: {$pIndex} is out of bounds. Actual number of sheets is {$numSheets}"
|
||||
"Your requested sheet index: {$pIndex} is out of bounds. The actual number of sheets is {$numSheets}"
|
||||
);
|
||||
} else {
|
||||
array_splice($this->_workSheetCollection, $pIndex, 1);
|
||||
@ -294,7 +294,7 @@ class PHPExcel
|
||||
|
||||
if ($pIndex > $numSheets - 1) {
|
||||
throw new PHPExcel_Exception(
|
||||
"The requested Sheet index: {$pIndex} is out of bounds. Actual number of sheets is {$numSheets}"
|
||||
"Your requested sheet index: {$pIndex} is out of bounds. The actual number of sheets is {$numSheets}"
|
||||
);
|
||||
} else {
|
||||
return $this->_workSheetCollection[$pIndex];
|
||||
@ -401,8 +401,12 @@ class PHPExcel
|
||||
*/
|
||||
public function setActiveSheetIndex($pIndex = 0)
|
||||
{
|
||||
if ($pIndex > count($this->_workSheetCollection) - 1) {
|
||||
throw new PHPExcel_Exception("Active sheet index is out of bounds.");
|
||||
$numSheets = count($this->_workSheetCollection);
|
||||
|
||||
if ($pIndex > $numSheets - 1) {
|
||||
throw new PHPExcel_Exception(
|
||||
"You tried to set a sheet active by an out of bounds index: {$pIndex}. The actual number of sheets is {$numSheets}."
|
||||
);
|
||||
} else {
|
||||
$this->_activeSheetIndex = $pIndex;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user