Invalid Index

This happened when I tried to load an Excel doc that was exported by Google Docs. I'm guessing there is no author information or something? I dunno but this fixed worked.
This commit is contained in:
Shawn Welch 2014-05-30 16:46:44 -04:00
parent 9a0071bff1
commit 5569c92449
1 changed files with 2 additions and 1 deletions

View File

@ -1302,6 +1302,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
// Loop through contents // Loop through contents
foreach ($commentsFile->commentList->comment as $comment) { foreach ($commentsFile->commentList->comment as $comment) {
if(!empty($comment['authorId']))
$docSheet->getComment( (string)$comment['ref'] )->setAuthor( $authors[(string)$comment['authorId']] ); $docSheet->getComment( (string)$comment['ref'] )->setAuthor( $authors[(string)$comment['authorId']] );
$docSheet->getComment( (string)$comment['ref'] )->setText( $this->_parseRichText($comment->text) ); $docSheet->getComment( (string)$comment['ref'] )->setText( $this->_parseRichText($comment->text) );
} }