From 8c3ce4f9388ae14ca25d7157e2797e93c2238675 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Thu, 28 Oct 2010 16:50:52 +0000 Subject: [PATCH] Minor performance tweak git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@62922 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Worksheet.php | 2 +- Classes/PHPExcel/Writer/Excel5/Worksheet.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Classes/PHPExcel/Worksheet.php b/Classes/PHPExcel/Worksheet.php index 44a95774..810bdb4b 100644 --- a/Classes/PHPExcel/Worksheet.php +++ b/Classes/PHPExcel/Worksheet.php @@ -430,7 +430,7 @@ class PHPExcel_Worksheet implements PHPExcel_IComparable { if (!is_null($this->_cellCollection)) { return $this->_cellCollection->getSortedCellList(); - } + } return array(); } diff --git a/Classes/PHPExcel/Writer/Excel5/Worksheet.php b/Classes/PHPExcel/Writer/Excel5/Worksheet.php index 51a158bb..3532281e 100644 --- a/Classes/PHPExcel/Writer/Excel5/Worksheet.php +++ b/Classes/PHPExcel/Writer/Excel5/Worksheet.php @@ -248,8 +248,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter $this->_lastColumnIndex = -1; foreach ($this->_phpSheet->getCellCollection(false) as $cellID) { - preg_match('/^(\w+)(\d+)$/U',$cellID,$matches); - list(,$col,$row) = $matches; + list($col,$row) = sscanf($cellID,'%[A-Z]%d'); $column = PHPExcel_Cell::columnIndexFromString($col) - 1; // Don't break Excel!