diff --git a/Classes/PHPExcel/Reader/Excel5.php b/Classes/PHPExcel/Reader/Excel5.php
index 191f5790..225fd6b9 100644
--- a/Classes/PHPExcel/Reader/Excel5.php
+++ b/Classes/PHPExcel/Reader/Excel5.php
@@ -820,11 +820,11 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
$offsetX = $startOffsetX * PHPExcel_Shared_Excel5::sizeCol($this->_phpSheet, $startColumn) / 1024;
$offsetY = $startOffsetY * PHPExcel_Shared_Excel5::sizeRow($this->_phpSheet, $startRow) / 256;
- switch ($obj['type']) {
+ switch ($obj['otObjType']) {
case 0x19:
// Note
-// echo 'Comment Object
';
+// echo 'Cell Annotation Object
';
break;
case 0x08:
@@ -1336,26 +1336,40 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
private function _readNote()
{
-// echo 'Read Note
';
+// echo 'Read Cell Annotation
';
$length = self::_GetInt2d($this->_data, $this->_pos + 2);
$recordData = substr($this->_data, $this->_pos + 4, $length);
// move stream pointer to next record
$this->_pos += 4 + $length;
- if ($this->_readDataOnly || $this->_version != self::XLS_BIFF8) {
+ if ($this->_readDataOnly) {
return;
}
-// hexDump($recordData);
-//
$cellAddress = $this->_readBIFF8CellAddress(substr($recordData, 0, 4));
- $noteObjID = self::_GetInt2d($recordData, 6);
- $noteAuthor = trim(substr($recordData, 8));
+ if ($this->_version == self::XLS_BIFF8) {
+ $noteObjID = self::_GetInt2d($recordData, 6);
+ $noteAuthor = trim(substr($recordData, 8));
+
+// echo 'Note Address=',$cellAddress,'
';
+// echo 'Note Object ID=',$noteObjID,'
';
+// echo 'Note Author=',$noteAuthor,'
';
+ } else {
+ $cellAddress = str_replace('$','',$cellAddress);
+// $noteLength = self::_GetInt2d($recordData, 4);
+ $noteText = trim(substr($recordData, 6));
+
+
+// echo 'Note Address=',$cellAddress,'
';
+// echo 'Note Length=',$noteLength,'
';
+// echo 'Note Text=',$noteText,'
';
+
+ $this->_phpSheet->getComment( $cellAddress )
+// ->setAuthor( $author )
+ ->setText($this->_parseRichText($noteText) );
+ }
-// echo 'Note Address=',$cellAddress,'
';
-// echo 'Note Object ID=',$noteObjID,'
';
-// echo 'Note Author=',$noteAuthor,'
';
}
/**
@@ -3747,16 +3761,28 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
}
// recordData consists of an array of subrecords looking like this:
- // ft: 2 bytes; id number
- // cb: 2 bytes; size in bytes of following data
+ // ft: 2 bytes; ftCmo type (0x15)
+ // cb: 2 bytes; size in bytes of ftCmo data
+ // ot: 2 bytes; Object Type
+ // id: 2 bytes; Object id number
+ // grbit: 2 bytes; Option Flags
// data: var; subrecord data
// for now, we are just interested in the second subrecord containing the object type
- $ot = self::_GetInt2d($recordData, 4);
+ $ftCmoType = self::_GetInt2d($recordData, 0);
+ $cbCmoSize = self::_GetInt2d($recordData, 2);
+ $otObjType = self::_GetInt2d($recordData, 4);
+ $idObjID = self::_GetInt2d($recordData, 6);
+ $grbitOpts = self::_GetInt2d($recordData, 6);
$this->_objs[] = array(
- 'type' => $ot,
+ 'ftCmoType' => $ftCmoType,
+ 'cbCmoSize' => $cbCmoSize,
+ 'otObjType' => $otObjType,
+ 'idObjID' => $idObjID,
+ 'grbitOpts' => $grbitOpts
);
+
}
/**
@@ -6491,4 +6517,12 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
}
}
+ private function _parseRichText($is = '') {
+ $value = new PHPExcel_RichText();
+
+ $value->createText($is);
+
+ return $value;
+ }
+
}
diff --git a/Documentation/Functionality Cross-Reference.xls b/Documentation/Functionality Cross-Reference.xls
index 3270fb5e..056a2f3a 100644
Binary files a/Documentation/Functionality Cross-Reference.xls and b/Documentation/Functionality Cross-Reference.xls differ
diff --git a/changelog.txt b/changelog.txt
index b7ec29b8..6961d4a4 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 OOCalc, Gnumeric and Excel2003XML Readers
+- Feature: (MBaker) Added support for cell comments in the OOCalc, Gnumeric and Excel2003XML Readers, and in the Excel5 Reader (for BIFF5-7... BIFF8 Still outstanding)
- 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