From 938ce8d51f0208410b6037be8d3cab4d5468ac6e Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Mon, 6 Aug 2012 22:40:24 +0100 Subject: [PATCH] Bugfix: Work item 18325 - v-type texts for series labels now recognised and parsed correctly --- Classes/PHPExcel/Chart/DataSeries.php | 10 +++++--- Classes/PHPExcel/Reader/Excel2007/Chart.php | 7 +++++ .../Functionality Cross-Reference.xls | Bin 37376 -> 37376 bytes changelog.txt | 1 + .../Classes/PHPExcel/Cell/DataTypeTest.php | 24 ++++++++++++++++++ 5 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 unitTests/Classes/PHPExcel/Cell/DataTypeTest.php diff --git a/Classes/PHPExcel/Chart/DataSeries.php b/Classes/PHPExcel/Chart/DataSeries.php index b58b4025..50e3a0f1 100644 --- a/Classes/PHPExcel/Chart/DataSeries.php +++ b/Classes/PHPExcel/Chart/DataSeries.php @@ -146,6 +146,7 @@ class PHPExcel_Chart_DataSeries if ((count($plotLabel) == 0) || (is_null($plotLabel[$keys[0]]))) { $plotLabel[$keys[0]] = new PHPExcel_Chart_DataSeriesValues(); } + $this->_plotLabel = $plotLabel; if ((count($plotCategory) == 0) || (is_null($plotCategory[$keys[0]]))) { $plotCategory[$keys[0]] = new PHPExcel_Chart_DataSeriesValues(); @@ -337,13 +338,16 @@ class PHPExcel_Chart_DataSeries public function refresh(PHPExcel_Worksheet $worksheet) { foreach($this->_plotValues as $plotValues) { - $plotValues->refresh($worksheet); + if ($plotValues !== NULL) + $plotValues->refresh($worksheet); } foreach($this->_plotLabel as $plotValues) { - $plotValues->refresh($worksheet); + if ($plotValues !== NULL) + $plotValues->refresh($worksheet); } foreach($this->_plotCategory as $plotValues) { - $plotValues->refresh($worksheet); + if ($plotValues !== NULL) + $plotValues->refresh($worksheet); } } diff --git a/Classes/PHPExcel/Reader/Excel2007/Chart.php b/Classes/PHPExcel/Reader/Excel2007/Chart.php index 865fb3d7..4a6981ca 100644 --- a/Classes/PHPExcel/Reader/Excel2007/Chart.php +++ b/Classes/PHPExcel/Reader/Excel2007/Chart.php @@ -305,6 +305,13 @@ class PHPExcel_Reader_Excel2007_Chart $seriesData['pointCount'] = count($seriesData['dataValues']); 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; } // function _chartDataSeriesValueSet() diff --git a/Documentation/Functionality Cross-Reference.xls b/Documentation/Functionality Cross-Reference.xls index 995ceeaa9d780cdd8e94e9384a0ac77f75e910e2..8df18cd5c3ae4463fd4b04050ff9e05d52984704 100644 GIT binary patch delta 2558 zcma)7&2Jk;6o0ecII(H%P=%o2P$i^snxt)F2WZlkrj7Hp_HJ!x%SRiE?bL~#qz;5! zs8Agtf#8CoOfN`9;*dWeV5#MR_&9(#1XNDF6p1SbIB-A#QHl3`^<<=}|jQ_k6OM zrJw*SP=O+>;X47H@Cg7s51R}>0LdV`fEHy~g=_c~JVX8qtucQP?jzA6{525D_jE`3 z6HU%&GpO@3O{9s|hO=-;1a+J?9McFzeAJ7$(?lynuZYeVjH+G~c3;p5I}mizneM3S zjy9c9q^t(|I_PAe)L}PuU2lGDFn;|MEj$q0`Gs(jp?EtCO>eb46WwlyZ>6%_$yH;3VuT&TL2hZ&t$YF^0&H@x)0XUTh`2H#n zE#0aQjqmC#SN|vV@#D39&?R<-MWID&g>H2DFZNUetfv8Xr~%g70E>HA4L~OD^FS9n z+yLuufDJUj1{+{U9>RuN;pjtPD;#Tp4G~uVZtgEu3&Ir8^a1YUAqc??47;;OB*(NM z(Bcgcqb9T>ds_T7ydmx5zXH6>*ng9;}R-Ys-JJ%J5CBszk)S0^gEfh|CA zM-`5WZ@`k|jv*(iO?jy5M$Inikei5#KY>Of*f8QLcS927fCU#^0?X~KHsO|=upqe%o=or5X7FVC zX8~oV<1FeN)Qkwq=St786yGZK*67gYP=pXmHqd?qvh~{w z5r*Kmi}t47N0S0i$8<6nRwe8rJD8c#Zha_2&EoxJg8-h}R*M@0yt@UTfxglhZ#|5Ym2&xwp-YJ2*QEfG;mGUDY%;Uc@?P{C+Q$p^zcMV! zE|2ea%#-8#alkqae0&c0!Kq)LsD!ln`u>^s@2y60Q0%)FN2}hBB)R_=d#DNaa1-p2 zCRlG1tgnGp0a^Ib2IymlnqZGL!TOtE15L2QcVMY@9JvE*$6ymI#j*OWGq<%+1UaPH z?XwS7v#qb=)02s22_74OD^?XQ9y@5(}6a)2XF*szhG*v8WocAIoqqDC z>S9#|Z_}b_5#&IS1aH^EisTLxHw)ecPtUs+g^suacp=_(mV896LBglKLT;ReImxBm zm^An0fn1G+6Ov3zQgB0r+BCl2D!3CFmwT3dxzKG`D6n4^x{q1lCzfY@Ldi2ssD-B` zH>_|^x?GW^O5KKyGb~@~896CEk1C!cgxYvsaw7^i>T)lz4@y1SDfSuVcux9_DSqRw z-;0tPSGWn6JI&&YJx{$PJtlpR8}vmx!oZrIplgr+=FllE|IIEe?qjt@Gw{F0#+**g zW}gsKbUN9aPCMInq9ZTM3R8XszHc<_v{SE0?zqBb3AJ&S-E#O&on!wv-PL(4NZ%R7 zmmdU+u3+&sW{LC9oqG^$y21rFr*Jtp&XHVB$;qcBj`NbE1BmIWf5t56ffHxJP*$e0 z3LYbiu10aPdHWVxl$ATIe!-}c< z$wzD#gfY*$miK!27J~FdfkJ6>^assertInternalType('array', $result); + $this->assertGreaterThan(0, count($result)); + $this->assertArrayHasKey('#NULL!', $result); + } + +}