Bugfix: Workitem 14146 - Worksheet clone broken for CachedObjectStorage_Memory

Bugfix: Workitem 12998 - PHPExcel_Reader_Excel2007 fails when gradient fill without type is present in a file
Bugfix: Workitem 14176 - @ format for numeric strings in XLSX to CSV conversion

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@60349 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker 2010-09-03 17:34:53 +00:00
parent da8bcea5b9
commit 04764644f7
4 changed files with 22 additions and 3 deletions

View File

@ -68,6 +68,19 @@ class PHPExcel_CachedObjectStorage_Memory extends PHPExcel_CachedObjectStorage_C
} // function getCacheData()
public function copyCellCollection(PHPExcel_Worksheet $parent) {
parent::copyCellCollection($parent);
$newCollection = array();
foreach($this->_cellCache as $k => &$cell) {
$newCollection[$k] = clone $cell;
$newCollection[$k]->attach($parent);
}
$this->_cellCache = $newCollection;
}
public function unsetWorksheetCells() {
// Because cells are all stored as intact objects in memory, we need to detach each one from the parent
foreach($this->_cellCache as $k => &$cell) {

View File

@ -1471,7 +1471,9 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
if (isset($style->fill)) {
if ($style->fill->gradientFill) {
$gradientFill = $style->fill->gradientFill[0];
$docStyle->getFill()->setFillType((string) $gradientFill["type"]);
if(!empty($gradientFill["type"])) {
$docStyle->getFill()->setFillType((string) $gradientFill["type"]);
}
$docStyle->getFill()->setRotation(floatval($gradientFill["degree"]));
$gradientFill->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main");
$docStyle->getFill()->getStartColor()->setARGB($this->_readColor( self::array_item($gradientFill->xpath("sml:stop[@position=0]"))->color) );

View File

@ -323,7 +323,7 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
self::$_builtInFormats = array();
// General
self::$_builtInFormats[0] = 'General';
self::$_builtInFormats[0] = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
self::$_builtInFormats[1] = '0';
self::$_builtInFormats[2] = '0.00';
self::$_builtInFormats[3] = '#,##0';
@ -509,7 +509,7 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
// For 'General' format code, we just pass the value although this is not entirely the way Excel does it,
// it seems to round numbers to a total of 10 digits.
if ($format === 'General') {
if (($format === PHPExcel_Style_NumberFormat::FORMAT_GENERAL) || ($format === PHPExcel_Style_NumberFormat::FORMAT_TEXT)) {
return $value;
}

View File

@ -31,6 +31,10 @@ Fixed in SVN:
- Bugfix: (MB) Work item 14143 - NA() doesn't propagate in matrix calc - quick fix in JAMA/Matrix.php
- Bugfix: (Progi1984) Workitem 7895 - Excel5 : Formula : Error constant
- Bugfix: (Progi1984) Workitem 7895 - Excel5 : Formula : Concatenation operator
- Bugfix: (MBaker) Workitem 14146 - Worksheet clone broken for CachedObjectStorage_Memory
- Bugfix: (MBaker) Workitem 12998 - PHPExcel_Reader_Excel2007 fails when gradient fill without type is present in a file
- Bugfix: (MBaker) Workitem 14176 - @ format for numeric strings in XLSX to CSV conversion
2010-08-26 (v1.7.4):
- Bugfix: (Progi1984) Workitem 7895 - Excel5 : Formula : Power