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

View File

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

View File

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