diff --git a/Classes/PHPExcel/Reader/OOCalc.php b/Classes/PHPExcel/Reader/OOCalc.php index 84f259f0..7aab6de0 100644 --- a/Classes/PHPExcel/Reader/OOCalc.php +++ b/Classes/PHPExcel/Reader/OOCalc.php @@ -405,6 +405,7 @@ class PHPExcel_Reader_OOCalc implements PHPExcel_Reader_IReader // echo ''.$columnID.$rowID.'
'; $cellDataText = $cellData->children($namespacesContent['text']); + $cellDataOffice = $cellData->children($namespacesContent['office']); $cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']); $cellDataTableAttributes = $cellData->attributes($namespacesContent['table']); @@ -424,6 +425,22 @@ class PHPExcel_Reader_OOCalc implements PHPExcel_Reader_IReader $hasCalculatedValue = true; } + if (isset($cellDataOffice->annotation)) { +// echo 'Cell has comment
'; + $annotationText = $cellDataOffice->annotation->children($namespacesContent['text']); + $textArray = array(); + foreach($annotationText as $t) { + foreach($t->span as $text) { + $textArray[] = (string)$text; + } + } + $text = implode("\n",$textArray); +// echo $text,'
'; + $objPHPExcel->getActiveSheet()->getComment( $columnID.$rowID ) +// ->setAuthor( $author ) + ->setText($this->_parseRichText($text) ); + } + if (isset($cellDataText->p)) { // echo 'Value Type is '.$cellDataOfficeAttributes['value-type'].'
'; switch ($cellDataOfficeAttributes['value-type']) { @@ -539,4 +556,12 @@ class PHPExcel_Reader_OOCalc implements PHPExcel_Reader_IReader return $objPHPExcel; } + private function _parseRichText($is = '') { + $value = new PHPExcel_RichText(); + + $value->createText($is); + + return $value; + } + } diff --git a/changelog.txt b/changelog.txt index 4ffc5522..b7ec29b8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -33,7 +33,7 @@ Fixed in SVN: - Feature: (MBaker) Added new rangeToArray() and namedRangeToArray() methods to the PHPExcel_Worksheet object. Functionally, these are identical to the toArray() method, except that they take an additional first parameter of a Range (e.g. 'B2:C3') or a Named Range name. Modified the toArray() method so that it actually uses rangeToArray(). -- Feature: (MBaker) Added support for cell comments in the Gnumeric and Excel2003XML Readers +- Feature: (MBaker) Added support for cell comments in the OOCalc, Gnumeric and Excel2003XML Readers - Bugfix: (MBaker) Work item 14888 - Simple =IF() formula disappears - Bugfix: (MBaker) Work item 14898 - PHP Warning: preg_match(): Compilation failed: PCRE does not support \\L, \\l, \\N, \\P, \\p, \\U, \\u, or \\X - Bugfix: (MBaker) Work item 14901 - VLOOKUP choking on parameters in PHPExcel.1.7.5/PHPExcel_Writer_Excel2007