Merge pull request #2806 from PHPOffice/Performance-Xls-Writer
Memory Experiment in Xls Writer
This commit is contained in:
commit
a86ad55a4a
|
|
@ -4,6 +4,7 @@ namespace PhpOffice\PhpSpreadsheet\Writer;
|
|||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Cell;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||
use PhpOffice\PhpSpreadsheet\RichText\RichText;
|
||||
use PhpOffice\PhpSpreadsheet\RichText\Run;
|
||||
|
|
@ -161,8 +162,9 @@ class Xls extends BaseWriter
|
|||
|
||||
// add fonts from rich text eleemnts
|
||||
for ($i = 0; $i < $countSheets; ++$i) {
|
||||
foreach ($this->writerWorksheets[$i]->phpSheet->getCoordinates() as $coordinate) {
|
||||
$cell = $this->writerWorksheets[$i]->phpSheet->getCell($coordinate);
|
||||
foreach ($this->writerWorksheets[$i]->phpSheet->getCellCollection()->getCoordinates() as $coordinate) {
|
||||
/** @var Cell $cell */
|
||||
$cell = $this->writerWorksheets[$i]->phpSheet->getCellCollection()->get($coordinate);
|
||||
$cVal = $cell->getValue();
|
||||
if ($cVal instanceof RichText) {
|
||||
$elements = $cVal->getRichTextElements();
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace PhpOffice\PhpSpreadsheet\Writer\Xls;
|
||||
|
||||
use GdImage;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Cell;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\DataType;
|
||||
use PhpOffice\PhpSpreadsheet\Exception as PhpSpreadsheetException;
|
||||
|
|
@ -406,8 +407,9 @@ class Worksheet extends BIFFwriter
|
|||
}
|
||||
|
||||
// Write Cells
|
||||
foreach ($phpSheet->getCoordinates() as $coordinate) {
|
||||
$cell = $phpSheet->getCell($coordinate);
|
||||
foreach ($phpSheet->getCellCollection()->getSortedCoordinates() as $coordinate) {
|
||||
/** @var Cell $cell */
|
||||
$cell = $phpSheet->getCellCollection()->get($coordinate);
|
||||
$row = $cell->getRow() - 1;
|
||||
$column = Coordinate::columnIndexFromString($cell->getColumn()) - 1;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue