From 6ea0ff9bfd3824a9be61b11942f34f26e545c82c Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Fri, 30 Dec 2011 01:08:05 +0000 Subject: [PATCH] Performance tweaks git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@84523 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Reader/CSV.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/PHPExcel/Reader/CSV.php b/Classes/PHPExcel/Reader/CSV.php index dfc0280f..814bb16a 100644 --- a/Classes/PHPExcel/Reader/CSV.php +++ b/Classes/PHPExcel/Reader/CSV.php @@ -215,7 +215,7 @@ class PHPExcel_Reader_CSV implements PHPExcel_Reader_IReader while ($objPHPExcel->getSheetCount() <= $this->_sheetIndex) { $objPHPExcel->createSheet(); } - $objPHPExcel->setActiveSheetIndex( $this->_sheetIndex ); + $sheet = $objPHPExcel->setActiveSheetIndex( $this->_sheetIndex ); $lineEnding = ini_get('auto_detect_line_endings'); ini_set('auto_detect_line_endings', true); @@ -259,7 +259,7 @@ class PHPExcel_Reader_CSV implements PHPExcel_Reader_IReader // Set our starting row based on whether we're in contiguous mode or not $currentRow = 1; if ($this->_contiguous) { - $currentRow = ($this->_contiguousRow == -1) ? $objPHPExcel->getActiveSheet()->getHighestRow(): $this->_contiguousRow; + $currentRow = ($this->_contiguousRow == -1) ? $sheet->getHighestRow(): $this->_contiguousRow; } // Loop through each line of the file in turn @@ -276,7 +276,7 @@ class PHPExcel_Reader_CSV implements PHPExcel_Reader_IReader } // Set cell value - $objPHPExcel->getActiveSheet()->getCell($columnLetter . $currentRow)->setValue($rowDatum); + $sheet->getCell($columnLetter . $currentRow)->setValue($rowDatum); } ++$columnLetter; }