diff --git a/Classes/PHPExcel/Reader/Excel5.php b/Classes/PHPExcel/Reader/Excel5.php
index e7d0d973..8568271a 100644
--- a/Classes/PHPExcel/Reader/Excel5.php
+++ b/Classes/PHPExcel/Reader/Excel5.php
@@ -334,6 +334,20 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
*/
private $_objs;
+ /**
+ * Text Objects. One TXO record corresponds with one entry.
+ *
+ * @var array
+ */
+ private $_textObjects;
+
+ /**
+ * Cell Annotations (BIFF8)
+ *
+ * @var array
+ */
+ private $_cellNotes;
+
/**
* The combined MSODRAWINGGROUP data
*
@@ -712,12 +726,18 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
// Initialize objs
$this->_objs = array();
+ // Initialize text objs
+ $this->_textObjects = array();
+
// Initialize shared formula parts
$this->_sharedFormulaParts = array();
// Initialize shared formulas
$this->_sharedFormulas = array();
+ // Initialize cell annotations
+ $this->_cellNotes = array();
+
while ($this->_pos <= $this->_dataSize - 4) {
$code = self::_GetInt2d($this->_data, $this->_pos);
@@ -771,6 +791,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
case self::XLS_Type_RANGEPROTECTION: $this->_readRangeProtection(); break;
case self::XLS_Type_NOTE: $this->_readNote(); break;
//case self::XLS_Type_IMDATA: $this->_readImData(); break;
+ case self::XLS_Type_TXO: $this->_readTextObject(); break;
case self::XLS_Type_CONTINUE: $this->_readContinue(); break;
case self::XLS_Type_EOF: $this->_readDefault(); break 2;
default: $this->_readDefault(); break;
@@ -794,7 +815,9 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
// treat OBJ records
foreach ($this->_objs as $n => $obj) {
-// echo 'Object ID is ',$n,'
';
+// echo 'Object ID is ',$n,'
';
+// var_dump($obj);
+// echo '
';
//
// the first shape container never has a corresponding OBJ record, hence $n + 1
$spContainer = $allSpContainers[$n + 1];
@@ -825,6 +848,9 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
case 0x19:
// Note
// echo 'Cell Annotation Object
';
+ $this->_objs[$n]['objTextData'] = $this->_textObjects[$obj['idObjID']-1];
+ $text = $this->_textObjects[$obj['idObjID']-1]['text'];
+// echo $text,'
';
break;
case 0x08:
@@ -884,6 +910,22 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
}
}
}
+
+ if (count($this->_cellNotes) > 0) {
+ foreach($this->_cellNotes as $note => $noteDetails) {
+// echo 'Cell annotation ',$note,'
';
+// var_dump($noteDetails);
+// echo '
';
+ if (isset($this->_objs[$noteDetails['objectID']-1])) {
+// var_dump($this->_objs[$noteDetails['objectID']-1]);
+// echo '
';
+ $cellAddress = str_replace('$','',$noteDetails['cellRef']);
+ $this->_phpSheet->getComment( $cellAddress )
+ ->setAuthor( $noteDetails['author'] )
+ ->setText($this->_parseRichText($this->_objs[$noteDetails['objectID']-1]['objTextData']['text']) );
+ }
+ }
+ }
}
// add the named ranges (defined names)
@@ -1359,6 +1401,11 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
// echo 'Note Address=',$cellAddress,'
';
// echo 'Note Object ID=',$noteObjID,'
';
// echo 'Note Author=',$noteAuthor,'