Fixed the OOCalc Reader that I broke a few days ago

This commit is contained in:
Mark Baker 2012-09-24 11:42:20 +01:00
parent 072dd6f23e
commit f2bfda68e9
3 changed files with 14 additions and 14 deletions

View File

@ -513,15 +513,12 @@ class PHPExcel_Reader_OOCalc implements PHPExcel_Reader_IReader
}
// echo '<b>'.$columnID.$rowID.'</b><br />';
if ($cellData->children) {
$cellDataText = $cellData->children($namespacesContent['text']);
$cellDataText = (isset($namespacesContent['text'])) ?
$cellData->children($namespacesContent['text']) :
'';
$cellDataOffice = $cellData->children($namespacesContent['office']);
$cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']);
$cellDataTableAttributes = $cellData->attributes($namespacesContent['table']);
} else {
$cellDataText = '';
$cellDataOffice = $cellDataOfficeAttributes = $cellDataTableAttributes = array();
}
// echo 'Office Attributes: ';
// print_r($cellDataOfficeAttributes);
@ -611,7 +608,10 @@ class PHPExcel_Reader_OOCalc implements PHPExcel_Reader_IReader
$type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
$dataValue = (float) $cellDataOfficeAttributes['value'];
if (floor($dataValue) == $dataValue) {
if ($dataValue = (integer) $dataValue)
$dataValue = (integer) $dataValue;
else
$dataValue = (float) $dataValue;
}
break;
case 'date' :
@ -638,7 +638,7 @@ class PHPExcel_Reader_OOCalc implements PHPExcel_Reader_IReader
// }
} else {
$type = PHPExcel_Cell_DataType::TYPE_NULL;
$dataValue = null;
$dataValue = NULL;
}
if ($hasCalculatedValue) {

View File

@ -188,7 +188,7 @@ $yAxisLabel2 = new PHPExcel_Chart_Title('Value ($k)');
// Create the chart
$chart2 = new PHPExcel_Chart(
'chart1', // name
'chart2', // name
$title2, // title
$legend2, // legend
$plotarea2, // plotArea

View File

@ -183,7 +183,7 @@ $title2 = new PHPExcel_Chart_Title('Test Donut Chart');
// Create the chart
$chart2 = new PHPExcel_Chart(
'chart1', // name
'chart2', // name
$title2, // title
NULL, // legend
$plotarea2, // plotArea