diff --git a/Classes/PHPExcel.php b/Classes/PHPExcel.php index bc85208..df111d4 100644 --- a/Classes/PHPExcel.php +++ b/Classes/PHPExcel.php @@ -244,6 +244,12 @@ class PHPExcel } else { array_splice($this->_workSheetCollection, $pIndex, 1); } + // Adjust active sheet index if necessary + if (($this->_activeSheetIndex >= $pIndex) && + ($pIndex > count($this->_workSheetCollection) - 1)) { + --$this->_activeSheetIndex; + } + } /** diff --git a/Classes/PHPExcel/Cell/DataType.php b/Classes/PHPExcel/Cell/DataType.php index 775d99d..e2410b3 100644 --- a/Classes/PHPExcel/Cell/DataType.php +++ b/Classes/PHPExcel/Cell/DataType.php @@ -41,7 +41,7 @@ class PHPExcel_Cell_DataType const TYPE_FORMULA = 'f'; const TYPE_NUMERIC = 'n'; const TYPE_BOOL = 'b'; - const TYPE_NULL = 's'; + const TYPE_NULL = 'null'; const TYPE_INLINE = 'inlineStr'; const TYPE_ERROR = 'e'; diff --git a/Classes/PHPExcel/Reader/CSV.php b/Classes/PHPExcel/Reader/CSV.php index ee342ac..dfc0280 100644 --- a/Classes/PHPExcel/Reader/CSV.php +++ b/Classes/PHPExcel/Reader/CSV.php @@ -217,7 +217,7 @@ class PHPExcel_Reader_CSV implements PHPExcel_Reader_IReader } $objPHPExcel->setActiveSheetIndex( $this->_sheetIndex ); - $lineEnding = ini_set('auto_detect_line_endings'); + $lineEnding = ini_get('auto_detect_line_endings'); ini_set('auto_detect_line_endings', true); // Open file diff --git a/Classes/PHPExcel/Reader/Excel2003XML.php b/Classes/PHPExcel/Reader/Excel2003XML.php index 6e437de..608bfe2 100644 --- a/Classes/PHPExcel/Reader/Excel2003XML.php +++ b/Classes/PHPExcel/Reader/Excel2003XML.php @@ -651,7 +651,7 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader const TYPE_FORMULA = 'f'; const TYPE_NUMERIC = 'n'; const TYPE_BOOL = 'b'; - const TYPE_NULL = 's'; + const TYPE_NULL = 'null'; const TYPE_INLINE = 'inlineStr'; const TYPE_ERROR = 'e'; */ diff --git a/Classes/PHPExcel/Writer/Excel5/Worksheet.php b/Classes/PHPExcel/Writer/Excel5/Worksheet.php index 8efe315..baa72a4 100644 --- a/Classes/PHPExcel/Writer/Excel5/Worksheet.php +++ b/Classes/PHPExcel/Writer/Excel5/Worksheet.php @@ -410,6 +410,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter } else { switch ($cell->getDatatype()) { case PHPExcel_Cell_DataType::TYPE_STRING: + case PHPExcel_Cell_DataType::TYPE_NULL: if ($cVal === '' || $cVal === null) { $this->_writeBlank($row, $column, $xfIndex); } else { diff --git a/Documentation/Functionality Cross-Reference.xls b/Documentation/Functionality Cross-Reference.xls index e25107a..c70fa93 100644 Binary files a/Documentation/Functionality Cross-Reference.xls and b/Documentation/Functionality Cross-Reference.xls differ diff --git a/changelog.txt b/changelog.txt index 3015f5c..cbacf02 100644 --- a/changelog.txt +++ b/changelog.txt @@ -40,9 +40,11 @@ Fixed in SVN: auto_detect_line_endings now set in CSV reader - Bugfix: (MBaker) Work item 16212 - $arguments improperly used in CachedObjectStorage/PHPTemp.php - Bugfix: (MBaker) Work item 16643 - Bug In Cache System (cell reference when throwing caching errors) +- Bugfix: (MBaker) Work item 16895 - PHP Invalid index notice on writing excel file when active sheet has been deleted - General: (MBaker) Work item 15405 - Two easy to fix Issues concerning PHPExcel_Token_Stack (l10n/UC) - General: (MBaker) Work item 15461 - Locale file paths not fit for windows - General: (MBaker) Work item 16643 - Add file directory as a cache option for cache_to_discISAM +- General: (MBaker) Work item 16923 - Datatype.php & constant TYPE_NULL 2011-02-27 (v1.7.6):