Bugfix: Work item 18325 - v-type texts for series labels now recognised and parsed correctly

This commit is contained in:
Mark Baker 2012-08-06 22:40:24 +01:00
parent 6c9a907027
commit 938ce8d51f
5 changed files with 39 additions and 3 deletions

View File

@ -146,6 +146,7 @@ class PHPExcel_Chart_DataSeries
if ((count($plotLabel) == 0) || (is_null($plotLabel[$keys[0]]))) { if ((count($plotLabel) == 0) || (is_null($plotLabel[$keys[0]]))) {
$plotLabel[$keys[0]] = new PHPExcel_Chart_DataSeriesValues(); $plotLabel[$keys[0]] = new PHPExcel_Chart_DataSeriesValues();
} }
$this->_plotLabel = $plotLabel; $this->_plotLabel = $plotLabel;
if ((count($plotCategory) == 0) || (is_null($plotCategory[$keys[0]]))) { if ((count($plotCategory) == 0) || (is_null($plotCategory[$keys[0]]))) {
$plotCategory[$keys[0]] = new PHPExcel_Chart_DataSeriesValues(); $plotCategory[$keys[0]] = new PHPExcel_Chart_DataSeriesValues();
@ -337,12 +338,15 @@ class PHPExcel_Chart_DataSeries
public function refresh(PHPExcel_Worksheet $worksheet) { public function refresh(PHPExcel_Worksheet $worksheet) {
foreach($this->_plotValues as $plotValues) { foreach($this->_plotValues as $plotValues) {
if ($plotValues !== NULL)
$plotValues->refresh($worksheet); $plotValues->refresh($worksheet);
} }
foreach($this->_plotLabel as $plotValues) { foreach($this->_plotLabel as $plotValues) {
if ($plotValues !== NULL)
$plotValues->refresh($worksheet); $plotValues->refresh($worksheet);
} }
foreach($this->_plotCategory as $plotValues) { foreach($this->_plotCategory as $plotValues) {
if ($plotValues !== NULL)
$plotValues->refresh($worksheet); $plotValues->refresh($worksheet);
} }
} }

View File

@ -305,6 +305,13 @@ class PHPExcel_Reader_Excel2007_Chart
$seriesData['pointCount'] = count($seriesData['dataValues']); $seriesData['pointCount'] = count($seriesData['dataValues']);
return new PHPExcel_Chart_DataSeriesValues('String',$seriesSource,$seriesData['formatCode'],$seriesData['pointCount'],$seriesData['dataValues'],$marker,$smoothLine); return new PHPExcel_Chart_DataSeriesValues('String',$seriesSource,$seriesData['formatCode'],$seriesData['pointCount'],$seriesData['dataValues'],$marker,$smoothLine);
} elseif (isset($seriesDetail->v)) {
$seriesData = array( 'formatCode' => '@',
'pointCount' => 1,
'dataValues' => array((string) $seriesDetail->v)
);
return new PHPExcel_Chart_DataSeriesValues('String',NULL,'@',1,$seriesData['dataValues'],$marker,$smoothLine);
} }
return null; return null;
} // function _chartDataSeriesValueSet() } // function _chartDataSeriesValueSet()

View File

@ -101,6 +101,7 @@ Fixed in develop branch:
- Bugfix: (MBaker) Work item 18377 - Chart Title compatibility on Excel 2007 - Bugfix: (MBaker) Work item 18377 - Chart Title compatibility on Excel 2007
- Bugfix: (MBaker) Work item 18146 - Chart Refresh returning cell reference rather than values - Bugfix: (MBaker) Work item 18146 - Chart Refresh returning cell reference rather than values
- Bugfix: (MBaker) Work item 18145 - Autoshape being identified in twoCellAnchor when includeCharts is TRUE triggering load error - Bugfix: (MBaker) Work item 18145 - Autoshape being identified in twoCellAnchor when includeCharts is TRUE triggering load error
- Bugfix: (MBaker) Work item 18325 - v-type texts for series labels now recognised and parsed correctly
2012-05-19 (v1.7.7): 2012-05-19 (v1.7.7):

View File

@ -0,0 +1,24 @@
<?php
class DataTypeTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testGetErrorCodes()
{
$result = call_user_func(array('PHPExcel_Cell_DataType','getErrorCodes'));
$this->assertInternalType('array', $result);
$this->assertGreaterThan(0, count($result));
$this->assertArrayHasKey('#NULL!', $result);
}
}