Improved speed and memory usage in Excel5 Writer

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@74786 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker 2011-06-01 23:09:12 +00:00
parent 3cbbcd87d5
commit 94e3dc3fd2
2 changed files with 12 additions and 15 deletions

View File

@ -236,24 +236,20 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
$this->_outline_on = 1;
// calculate values for DIMENSIONS record
$minR = $maxR = 1;
$minC = $maxC = '1A';
foreach ($this->_phpSheet->getCellCollection(false) as $cellID) {
list($c,$r) = sscanf($cellID,'%[A-Z]%d');
$minR = min($minR,$r);
$maxR = max($maxR,$r);
$C = strlen($c).$c;
$minC = min($minC,$C);
$maxC = max($maxC,$C);
}
$minR = 1;
$minC = 'A';
$maxR = $this->_phpSheet->getHighestRow();
$maxC = $this->_phpSheet->getHighestColumn();
// Determine lowest and highest column and row
$this->_firstRowIndex = ($minR > 65535) ? $minR: 65535;
$this->_lastRowIndex = ($maxR > 65535) ? $maxR : 65535;
// $this->_firstRowIndex = ($minR > 65535) ? 65535 : $minR;
$this->_lastRowIndex = ($maxR > 65535) ? 65535 : $maxR ;
$this->_firstColumnIndex = PHPExcel_Cell::columnIndexFromString(substr($minC,1));
$this->_lastColumnIndex = PHPExcel_Cell::columnIndexFromString(substr($maxC,1));
$this->_firstColumnIndex = PHPExcel_Cell::columnIndexFromString($minC);
$this->_lastColumnIndex = PHPExcel_Cell::columnIndexFromString($maxC);
if ($this->_firstColumnIndex > 255) $this->_firstColumnIndex = 255;
// if ($this->_firstColumnIndex > 255) $this->_firstColumnIndex = 255;
if ($this->_lastColumnIndex > 255) $this->_lastColumnIndex = 255;
$this->_countCellStyleXfs = count($phpSheet->getParent()->getCellStyleXfCollection());

View File

@ -27,6 +27,7 @@ Fixed in SVN:
- General: (MBaker) Fix to build to ensure that Examples are included with the documentation
- General: (MBaker) Reduce cell caching overhead using dirty flag to ensure that cells are only rewritten to the cache if they have actually been changed
- General: (MBaker) Improved memory usage in CSV Writer
- General: (MBaker) Improved speed and memory usage in Excel5 Writer
- Bugfix: (MBaker) Work item 15459 - Invalid cell coordinate in Autofilter for Excel2007 Writer
- Bugfix: (MBaker) Work item 15518 - PCLZip library issue
- Bugfix: (MBaker) Work item 15537 - Excel2007 Reader canRead function bug