From d13ca1f790a20247ebf85717344decceafde0596 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Tue, 11 Dec 2012 21:55:46 +0000 Subject: [PATCH] Bugfix: Work item GH-104 - echo statements in HTML.php --- Classes/PHPExcel/Reader/HTML.php | 50 ++++++++++++++++---------------- changelog.txt | 33 +++++++++++---------- 2 files changed, 42 insertions(+), 41 deletions(-) diff --git a/Classes/PHPExcel/Reader/HTML.php b/Classes/PHPExcel/Reader/HTML.php index 6462b798..4e8b8e99 100644 --- a/Classes/PHPExcel/Reader/HTML.php +++ b/Classes/PHPExcel/Reader/HTML.php @@ -201,7 +201,7 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_ // Simple String content if (trim($cellContent) > '') { // Only actually write it if there's content in the string - echo 'FLUSH CELL: ' , $column , $row , ' => ' , $cellContent , '
'; +// echo 'FLUSH CELL: ' , $column , $row , ' => ' , $cellContent , '
'; // Write to worksheet to be done here... // ... we return the cell so we can mess about with styles more easily $cell = $sheet->setCellValue($column.$row,$cellContent,true); @@ -227,11 +227,11 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_ // TODO } } elseif($child instanceof DOMElement) { - echo 'DOM ELEMENT: ' , strtoupper($child->nodeName) , '
'; +// echo 'DOM ELEMENT: ' , strtoupper($child->nodeName) , '
'; $attributeArray = array(); foreach($child->attributes as $attribute) { - echo 'ATTRIBUTE: ' , $attribute->name , ' => ' , $attribute->value , '
'; +// echo 'ATTRIBUTE: ' , $attribute->name , ' => ' , $attribute->value , '
'; $attributeArray[$attribute->name] = $attribute->value; } @@ -259,13 +259,13 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_ case 'em' : case 'strong': case 'b' : - echo 'STYLING, SPAN OR DIV
'; +// echo 'STYLING, SPAN OR DIV
'; if ($cellContent > '') $cellContent .= ' '; $this->_processDomElement($child,$sheet,$row,$column,$cellContent); if ($cellContent > '') $cellContent .= ' '; - echo 'END OF STYLING, SPAN OR DIV
'; +// echo 'END OF STYLING, SPAN OR DIV
'; break; case 'hr' : $this->_flushCell($sheet,$column,$row,$cellContent); @@ -286,14 +286,14 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_ $this->_flushCell($sheet,$column,$row,$cellContent); ++$row; } - echo 'HARD LINE BREAK: ' , '
'; +// echo 'HARD LINE BREAK: ' , '
'; break; case 'a' : - echo 'START OF HYPERLINK: ' , '
'; +// echo 'START OF HYPERLINK: ' , '
'; foreach($attributeArray as $attributeName => $attributeValue) { switch($attributeName) { case 'href': - echo 'Link to ' , $attributeValue , '
'; +// echo 'Link to ' , $attributeValue , '
'; $sheet->getCell($column.$row)->getHyperlink()->setUrl($attributeValue); if (isset($this->_formats[$child->nodeName])) { $sheet->getStyle($column.$row)->applyFromArray($this->_formats[$child->nodeName]); @@ -303,7 +303,7 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_ } $cellContent .= ' '; $this->_processDomElement($child,$sheet,$row,$column,$cellContent); - echo 'END OF HYPERLINK:' , '
'; +// echo 'END OF HYPERLINK:' , '
'; break; case 'h1' : case 'h2' : @@ -317,17 +317,17 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_ if ($this->_tableLevel > 0) { // If we're inside a table, replace with a \n $cellContent .= "\n"; - echo 'LIST ENTRY: ' , '
'; +// echo 'LIST ENTRY: ' , '
'; $this->_processDomElement($child,$sheet,$row,$column,$cellContent); - echo 'END OF LIST ENTRY:' , '
'; +// echo 'END OF LIST ENTRY:' , '
'; } else { if ($cellContent > '') { $this->_flushCell($sheet,$column,$row,$cellContent); $row += 2; } - echo 'START OF PARAGRAPH: ' , '
'; +// echo 'START OF PARAGRAPH: ' , '
'; $this->_processDomElement($child,$sheet,$row,$column,$cellContent); - echo 'END OF PARAGRAPH:' , '
'; +// echo 'END OF PARAGRAPH:' , '
'; $this->_flushCell($sheet,$column,$row,$cellContent); if (isset($this->_formats[$child->nodeName])) { @@ -342,17 +342,17 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_ if ($this->_tableLevel > 0) { // If we're inside a table, replace with a \n $cellContent .= "\n"; - echo 'LIST ENTRY: ' , '
'; +// echo 'LIST ENTRY: ' , '
'; $this->_processDomElement($child,$sheet,$row,$column,$cellContent); - echo 'END OF LIST ENTRY:' , '
'; +// echo 'END OF LIST ENTRY:' , '
'; } else { if ($cellContent > '') { $this->_flushCell($sheet,$column,$row,$cellContent); } ++$row; - echo 'LIST ENTRY: ' , '
'; +// echo 'LIST ENTRY: ' , '
'; $this->_processDomElement($child,$sheet,$row,$column,$cellContent); - echo 'END OF LIST ENTRY:' , '
'; +// echo 'END OF LIST ENTRY:' , '
'; $this->_flushCell($sheet,$column,$row,$cellContent); $column = 'A'; } @@ -360,11 +360,11 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_ case 'table' : $this->_flushCell($sheet,$column,$row,$cellContent); $column = $this->_setTableStartColumn($column); - echo 'START OF TABLE LEVEL ' , $this->_tableLevel , '
'; +// echo 'START OF TABLE LEVEL ' , $this->_tableLevel , '
'; if ($this->_tableLevel > 1) --$row; $this->_processDomElement($child,$sheet,$row,$column,$cellContent); - echo 'END OF TABLE LEVEL ' , $this->_tableLevel , '
'; +// echo 'END OF TABLE LEVEL ' , $this->_tableLevel , '
'; $column = $this->_releaseTableStartColumn(); if ($this->_tableLevel > 1) { ++$column; @@ -380,15 +380,15 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_ ++$row; $column = $this->_getTableStartColumn(); $cellContent = ''; - echo 'START OF TABLE ' , $this->_tableLevel , ' ROW
'; +// echo 'START OF TABLE ' , $this->_tableLevel , ' ROW
'; $this->_processDomElement($child,$sheet,$row,$column,$cellContent); - echo 'END OF TABLE ' , $this->_tableLevel , ' ROW
'; +// echo 'END OF TABLE ' , $this->_tableLevel , ' ROW
'; break; case 'th' : case 'td' : - echo 'START OF TABLE ' , $this->_tableLevel , ' CELL
'; +// echo 'START OF TABLE ' , $this->_tableLevel , ' CELL
'; $this->_processDomElement($child,$sheet,$row,$column,$cellContent); - echo 'END OF TABLE ' , $this->_tableLevel , ' CELL
'; +// echo 'END OF TABLE ' , $this->_tableLevel , ' CELL
'; $this->_flushCell($sheet,$column,$row,$cellContent); ++$column; break; @@ -448,8 +448,8 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_ $content = ''; $this->_processDomElement($dom,$objPHPExcel->getActiveSheet(),$row,$column,$content); - echo '
'; - var_dump($this->_dataArray); +// echo '
'; +// var_dump($this->_dataArray); // Return return $objPHPExcel; diff --git a/changelog.txt b/changelog.txt index 6899e331..1bf81f2e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -26,24 +26,25 @@ Fixed in develop branch: - Feature: (MBaker) Include charts option for HTML Writer - Feature: (MBaker) Added composer file -- Bugfix: (Asker) Work item 18777 - Error in PHPEXCEL/Calculation.php script on line 2976 (stack pop check) -- Bugfix: (MBaker) Work item 18794 - CSV files without a file extension being identified as HTML -- Bugfix: (AndreKR) Work item GH-66 - Wrong check for maximum number of rows in Excel5 Writer -- Bugfix: (MBaker) Work item GH-67 - Cache directory for DiscISAM cache storage cannot be set -- Bugfix: (MBaker) Work item 17976 - Fix to Excel2007 Reader for hyperlinks with an anchor fragment (following a #), otherwise they were treated as sheet references -- Bugfix: (MBaker) Work item 18963 - getSheetNames() fails on numeric (floating point style) names with trailing zeroes -- General: (kea) Work item GH-69 - Improved AdvancedValueBinder for currency +- Bugfix: (Asker) Work item 18777 - Error in PHPEXCEL/Calculation.php script on line 2976 (stack pop check) +- Bugfix: (MBaker) Work item 18794 - CSV files without a file extension being identified as HTML +- Bugfix: (AndreKR) Work item GH-66 - Wrong check for maximum number of rows in Excel5 Writer +- Bugfix: (MBaker) Work item GH-67 - Cache directory for DiscISAM cache storage cannot be set +- Bugfix: (MBaker) Work item 17976 - Fix to Excel2007 Reader for hyperlinks with an anchor fragment (following a #), otherwise they were treated as sheet references +- Bugfix: (MBaker) Work item 18963 - getSheetNames() fails on numeric (floating point style) names with trailing zeroes +- General: (kea) Work item GH-69 - Improved AdvancedValueBinder for currency - General: (MBaker) Work items 17936 and 17840 - Fix for environments where there is no access to /tmp but to upload_tmp_dir Provided an option to set the sys_get_temp_dir() call to use the upload_tmp_dir; though by default the standard temp directory will still be used -- General: (amironov ) Work item GH-84 - Search style by identity in PHPExcel_Worksheet::duplicateStyle() -- General: (karak) Work item GH-85 - Fill SheetView IO in Excel5 -- General: (cfhay) Work item 18958 - Memory and Speed improvements in PHPExcel_Reader_Excel5 -- Bugfix: (techhead) Work item GH-70 - Fixed formula/formatting bug when removing rows -- Bugfix: (alexgann) Work item GH-63 - Fix to cellExists for non-existent namedRanges -- Bugfix: (MBaker) Work item 18844 - cache_in_memory_gzip "eats" last worksheet line, cache_in_memory doesn't -- Bugfix: (Progi1984) Work item GH-22 - Sheet View in Excel5 Writer -- Bugfix: (amironov) Work item GH-82 - PHPExcel_Worksheet::getCellCollection() may not return last cached cell -- Bugfix: (teso) Work item 18551 - Rich Text containing UTF-8 characters creating unreadable content with Excel5 Writer +- General: (amironov ) Work item GH-84 - Search style by identity in PHPExcel_Worksheet::duplicateStyle() +- General: (karak) Work item GH-85 - Fill SheetView IO in Excel5 +- General: (cfhay) Work item 18958 - Memory and Speed improvements in PHPExcel_Reader_Excel5 +- Bugfix: (techhead) Work item GH-70 - Fixed formula/formatting bug when removing rows +- Bugfix: (alexgann) Work item GH-63 - Fix to cellExists for non-existent namedRanges +- Bugfix: (MBaker) Work item 18844 - cache_in_memory_gzip "eats" last worksheet line, cache_in_memory doesn't +- Bugfix: (Progi1984) Work item GH-22 - Sheet View in Excel5 Writer +- Bugfix: (amironov) Work item GH-82 - PHPExcel_Worksheet::getCellCollection() may not return last cached cell +- Bugfix: (teso) Work item 18551 - Rich Text containing UTF-8 characters creating unreadable content with Excel5 Writer +- Bugfix: (MBaker) Work item GH-104 - echo statements in HTML.php --------------------------------------------------------------------------------