From 30070f35c2b8bc10926e234c70fec3c4a5ec158b Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Sat, 28 Dec 2013 13:40:24 +0000 Subject: [PATCH] Bugfix: Work Item GH-257 - Passing an array of cells to _generateRow() in the HTML/PDF Writer causes caching problems with last cell in the range --- Classes/PHPExcel/Writer/HTML.php | 6 +++--- changelog.txt | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Classes/PHPExcel/Writer/HTML.php b/Classes/PHPExcel/Writer/HTML.php index e0a2d784..a003b6d2 100644 --- a/Classes/PHPExcel/Writer/HTML.php +++ b/Classes/PHPExcel/Writer/HTML.php @@ -428,7 +428,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_ while($column++ < $dimension[1][0]) { // Cell exists? if ($sheet->cellExistsByColumnAndRow($column, $row)) { - $rowData[$column] = $sheet->getCellByColumnAndRow($column, $row); + $rowData[$column] = PHPExcel_Cell::stringFromColumnIndex($column) . $row; } else { $rowData[$column] = ''; } @@ -1114,9 +1114,9 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_ // Write cells $colNum = 0; - foreach ($pValues as $cell) { + foreach ($pValues as $cellAddress) { + $cell = ($cellAddress > '') ? $pSheet->getCell($cellAddress) : ''; $coordinate = PHPExcel_Cell::stringFromColumnIndex($colNum) . ($pRow + 1); - if (!$this->_useInlineCss) { $cssClass = ''; $cssClass = 'column' . $colNum; diff --git a/changelog.txt b/changelog.txt index d213be5e..db0bc146 100644 --- a/changelog.txt +++ b/changelog.txt @@ -40,6 +40,7 @@ Fixed in develop branch for release v1.8.0: - Bugfix: (PowerKiKi) Work Item GH-273 - ISTEXT() return wrong result if referencing an empty but formatted cell - Bugfix: (PowerKiKi) Work Item GH-270/GH-31 - Binary comparison of strings are case insensitive - Bugfix: (MBaker) Work Item GH-275 - Insert New Row/Column Before is not correctly updating formula references +- Bugfix: (MBaker) Work Item GH-257 - Passing an array of cells to _generateRow() in the HTML/PDF Writer causes caching problems with last cell in the range - Feature: (amerov) - Implementation of the Excel HLOOKUP() function - Feature: (MBaker) - Added "Quote Prefix" to style settings (Excel2007 Reader and Writer only) - Feature: (MBaker) - Added Horizontal FILL alignment for Excel5 and Excel2007 Readers/Writers, and Horizontal DISTRIBUTED alignment for Excel2007 Reader/Writer