Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions SpreadsheetReader_XLS.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,16 @@ public function ChangeSheet($Index)
{
$this -> rewind();
$this -> CurrentSheet = $this -> SheetIndexes[$Index];
$currentSheet = $this -> Handle -> sheets[$this -> CurrentSheet];

$this -> ColumnCount = $this -> Handle -> sheets[$this -> CurrentSheet]['numCols'];
$this -> RowCount = $this -> Handle -> sheets[$this -> CurrentSheet]['numRows'];
$this -> ColumnCount = $currentSheet['numCols'];
$this -> RowCount = $currentSheet['numRows'];

// For the case when Spreadsheet_Excel_Reader doesn't have the row count set correctly.
if (!$this -> RowCount && count($this -> Handle -> sheets[$this -> CurrentSheet]['cells']))
if (!$this -> RowCount && isset($currentSheet['cells']) && count($currentSheet['cells']))
{
end($this -> Handle -> sheets[$this -> CurrentSheet]['cells']);
$this -> RowCount = (int)key($this -> Handle -> sheets[$this -> CurrentSheet]['cells']);
end($currentSheet['cells']);
$this -> RowCount = (int)key($currentSheet['cells']);
}

if ($this -> ColumnCount)
Expand Down Expand Up @@ -263,4 +264,4 @@ public function count()
return $this -> RowCount;
}
}
?>
?>