Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

Commit

Permalink
Bugfix: Work item GH-80 - "Sheet index is out of bounds." Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Baker committed Feb 27, 2013
1 parent 7b922bb commit e47b543
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions Classes/PHPExcel/Reader/Excel2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -1608,15 +1608,16 @@ public function load($pFilename)
break;

default:
$range = explode('!', (string)$definedName);
if (count($range) == 2) {
$range[0] = str_replace("''", "'", $range[0]);
$range[0] = str_replace("'", "", $range[0]);
if ($worksheet = $docSheet->getParent()->getSheetByName($range[0])) {
$extractedRange = str_replace('$', '', $range[1]);
$scope = $docSheet->getParent()->getSheet((string)$definedName['localSheetId']);

$excel->addNamedRange( new PHPExcel_NamedRange((string)$definedName['name'], $worksheet, $extractedRange, true, $scope) );
if ($mapSheetId[(integer) $definedName['localSheetId']] !== null) {
$range = explode('!', (string)$definedName);
if (count($range) == 2) {
$range[0] = str_replace("''", "'", $range[0]);
$range[0] = str_replace("'", "", $range[0]);
if ($worksheet = $docSheet->getParent()->getSheetByName($range[0])) {
$extractedRange = str_replace('$', '', $range[1]);
$scope = $docSheet->getParent()->getSheet($mapSheetId[(integer) $definedName['localSheetId']]);
$excel->addNamedRange( new PHPExcel_NamedRange((string)$definedName['name'], $worksheet, $extractedRange, true, $scope) );
}
}
}
break;
Expand Down
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Fixed in develop branch:
- Bugfix: (MBaker) Work item GH-104 - echo statements in HTML.php
- Feature: (Progi1984) Work item GH-8/CP11704 : Conditional formatting in Excel 5 Writer
- Bugfix: (MBaker) Work item GH-113 - canRead() Error for GoogleDocs ODS files: in ODS files from Google Docs there is no mimetype file

- Bugfix: (MBaker) Work item GH-80 - "Sheet index is out of bounds." Exception

--------------------------------------------------------------------------------
BREAKING CHANGE! As part of the planned changes for handling array formulae in
Expand Down

0 comments on commit e47b543

Please sign in to comment.