diff --git a/Classes/PHPExcel/Reader/Excel2003XML.php b/Classes/PHPExcel/Reader/Excel2003XML.php index 70e5290..4632860 100644 --- a/Classes/PHPExcel/Reader/Excel2003XML.php +++ b/Classes/PHPExcel/Reader/Excel2003XML.php @@ -325,43 +325,45 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader $namespaces = $xml->getNamespaces(true); $docProps = $objPHPExcel->getProperties(); - foreach($xml->DocumentProperties[0] as $propertyName => $propertyValue) { - switch ($propertyName) { - case 'Title' : - $docProps->setTitle($propertyValue); - break; - case 'Subject' : - $docProps->setSubject($propertyValue); - break; - case 'Author' : - $docProps->setCreator($propertyValue); - break; - case 'Created' : - $creationDate = strtotime($propertyValue); - $docProps->setCreated($creationDate); - break; - case 'LastAuthor' : - $docProps->setLastModifiedBy($propertyValue); - break; - case 'LastSaved' : - $lastSaveDate = strtotime($propertyValue); - $docProps->setModified($lastSaveDate); - break; - case 'Company' : - $docProps->setCompany($propertyValue); - break; - case 'Category' : - $docProps->setCategory($propertyValue); - break; - case 'Manager' : - $docProps->setManager($propertyValue); - break; - case 'Keywords' : - $docProps->setKeywords($propertyValue); - break; - case 'Description' : - $docProps->setDescription($propertyValue); - break; + if (isset($xml->DocumentProperties[0])) { + foreach($xml->DocumentProperties[0] as $propertyName => $propertyValue) { + switch ($propertyName) { + case 'Title' : + $docProps->setTitle($propertyValue); + break; + case 'Subject' : + $docProps->setSubject($propertyValue); + break; + case 'Author' : + $docProps->setCreator($propertyValue); + break; + case 'Created' : + $creationDate = strtotime($propertyValue); + $docProps->setCreated($creationDate); + break; + case 'LastAuthor' : + $docProps->setLastModifiedBy($propertyValue); + break; + case 'LastSaved' : + $lastSaveDate = strtotime($propertyValue); + $docProps->setModified($lastSaveDate); + break; + case 'Company' : + $docProps->setCompany($propertyValue); + break; + case 'Category' : + $docProps->setCategory($propertyValue); + break; + case 'Manager' : + $docProps->setManager($propertyValue); + break; + case 'Keywords' : + $docProps->setKeywords($propertyValue); + break; + case 'Description' : + $docProps->setDescription($propertyValue); + break; + } } } if (isset($xml->CustomDocumentProperties)) { @@ -577,6 +579,12 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader } $cellRange = $columnID.$rowID; + if (!is_null($this->getReadFilter())) { + if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) { + continue; + } + } + if ((isset($cell_ss['MergeAcross'])) || (isset($cell_ss['MergeDown']))) { $columnTo = $columnID; if (isset($cell_ss['MergeAcross'])) { diff --git a/Classes/PHPExcel/Reader/OOCalc.php b/Classes/PHPExcel/Reader/OOCalc.php index 8dab6c5..5e8b619 100644 --- a/Classes/PHPExcel/Reader/OOCalc.php +++ b/Classes/PHPExcel/Reader/OOCalc.php @@ -262,8 +262,6 @@ class PHPExcel_Reader_OOCalc implements PHPExcel_Reader_IReader $officePropertyDC = $officePropertyData->children($namespacesMeta['dc']); } foreach($officePropertyDC as $propertyName => $propertyValue) { -// echo $propertyName.' = '.$propertyValue.'
'; - switch ($propertyName) { case 'title' : $docProps->setTitle($propertyValue); @@ -291,13 +289,6 @@ class PHPExcel_Reader_OOCalc implements PHPExcel_Reader_IReader } foreach($officePropertyMeta as $propertyName => $propertyValue) { $propertyValueAttributes = $propertyValue->attributes($namespacesMeta['meta']); - -// echo $propertyName.' = '.$propertyValue.'
'; -// foreach ($propertyValueAttributes as $key => $value) { -// echo $key.' = '.$value.'
'; -// } -// echo '
'; -// switch ($propertyName) { case 'initial-creator' : $docProps->setCreator($propertyValue); @@ -384,6 +375,12 @@ class PHPExcel_Reader_OOCalc implements PHPExcel_Reader_IReader case 'table-row' : $columnID = 'A'; foreach($rowData as $key => $cellData) { + if (!is_null($this->getReadFilter())) { + if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) { + continue; + } + } + // echo ''.$columnID.$rowID.'
'; $cellDataText = $cellData->children($namespacesContent['text']); $cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']); diff --git a/Documentation/Functionality Cross-Reference.xls b/Documentation/Functionality Cross-Reference.xls index fb38212..9a1275e 100644 Binary files a/Documentation/Functionality Cross-Reference.xls and b/Documentation/Functionality Cross-Reference.xls differ diff --git a/Tests/Excel2003XMLReader.php b/Tests/Excel2003XMLReader.php new file mode 100644 index 0000000..58858f0 --- /dev/null +++ b/Tests/Excel2003XMLReader.php @@ -0,0 +1,75 @@ + + + + + +PHPExcel Excel2003XML Reader Test + + + + +load("Excel2003XMLTest.xml"); + + +$callEndTime = microtime(true); +$callTime = $callEndTime - $callStartTime; +echo '
Call time to read Workbook was '.sprintf('%.4f',$callTime)." seconds
\n"; +// Echo memory usage +echo date('H:i:s').' Current memory usage: '.(memory_get_usage(true) / 1024 / 1024)." MB

\n"; + + +echo date('H:i:s') . " Write to Excel2007 format
"; +$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); +$objWriter->save(str_replace('.php', '.xlsx', __FILE__)); + + +// Echo memory peak usage +echo date('H:i:s') . " Peak memory usage: " . (memory_get_peak_usage(true) / 1024 / 1024) . " MB
"; + +// Echo done +echo date('H:i:s') . " Done writing file.
"; + +?> + + \ No newline at end of file diff --git a/Tests/Excel2003XMLTest.xml b/Tests/Excel2003XMLTest.xml new file mode 100644 index 0000000..fb2d305 --- /dev/null +++ b/Tests/Excel2003XMLTest.xml @@ -0,0 +1 @@ +3#0000004#0000ff5#0080006#00ccff7#8000808#9933669#c0c0c010#c4751211#ccffcc12#ddbc7d13#ff000014#ff00ff15#ff660016#ff990017#ff99cc18#ffff0090001386024075FalseFalse