BIFF8 now working on Excel

git-svn-id: https://svn.php.net/repository/pear/packages/Spreadsheet_Excel_Writer/trunk@144068 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Xavier Noguer Gallego 2003-11-10 13:09:41 +00:00
parent 02036526a2
commit 7f07ab2914
2 changed files with 25 additions and 16 deletions

View File

@ -555,14 +555,21 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
*/ */
function _calcSheetOffsets() function _calcSheetOffsets()
{ {
$BOF = 11; $boundsheet_length = 12; // fixed length for a BOUNDSHEET record
$EOF = 4; $EOF = 4;
$offset = $this->_datasize; $offset = $this->_datasize;
// add the length of the SST
$offset += 12; // FIXME: update when updating _storeSharedStringsTable()
// add the lenght of SUPBOOK, EXTERNSHEET and NAME records
$offset += 0; // FIXME: calculate real value when storing the records
$total_worksheets = count($this->_worksheets); $total_worksheets = count($this->_worksheets);
// add the length of the BOUNDSHEET records
for ($i=0; $i < $total_worksheets; $i++) { for ($i=0; $i < $total_worksheets; $i++) {
$offset += $BOF + strlen($this->_worksheets[$i]->name); $offset += $boundsheet_length + strlen($this->_worksheets[$i]->name);
} }
$offset += $EOF; $offset += $EOF;
for ($i=0; $i < $total_worksheets; $i++) { for ($i=0; $i < $total_worksheets; $i++) {
$this->_worksheets[$i]->offset = $offset; $this->_worksheets[$i]->offset = $offset;
$offset += $this->_worksheets[$i]->_datasize; $offset += $this->_worksheets[$i]->_datasize;
@ -1213,6 +1220,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
* *
* @access private * @access private
*/ */
/* FIXME: update _calcSheetOffsets() when updating this method */
function _storeSharedStringsTable() function _storeSharedStringsTable()
{ {
$record = 0x00fc; // Record identifier $record = 0x00fc; // Record identifier

View File

@ -102,28 +102,28 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr
/** /**
* First row for the DIMENSIONS record * First row for the DIMENSIONS record
* @var integer * @var integer
* @see storeDimensions() * @see _storeDimensions()
*/ */
var $_dim_rowmin; var $_dim_rowmin;
/** /**
* Last row for the DIMENSIONS record * Last row for the DIMENSIONS record
* @var integer * @var integer
* @see storeDimensions() * @see _storeDimensions()
*/ */
var $_dim_rowmax; var $_dim_rowmax;
/** /**
* First column for the DIMENSIONS record * First column for the DIMENSIONS record
* @var integer * @var integer
* @see storeDimensions() * @see _storeDimensions()
*/ */
var $_dim_colmin; var $_dim_colmin;
/** /**
* Last column for the DIMENSIONS record * Last column for the DIMENSIONS record
* @var integer * @var integer
* @see storeDimensions() * @see _storeDimensions()
*/ */
var $_dim_colmax; var $_dim_colmax;
@ -470,7 +470,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr
*/ */
// Prepend the sheet dimensions // Prepend the sheet dimensions
$this->storeDimensions(); $this->_storeDimensions();
// Prepend the sheet password // Prepend the sheet password
$this->_storePassword(); $this->_storePassword();
@ -481,6 +481,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr
// Prepend the page setup // Prepend the page setup
$this->_storeSetup(); $this->_storeSetup();
/* FIXME: margins are actually appended */
// Prepend the bottom margin // Prepend the bottom margin
$this->_storeMarginBottom(); $this->_storeMarginBottom();
@ -2053,14 +2054,14 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr
* *
* @access private * @access private
*/ */
function storeDimensions() function _storeDimensions()
{ {
$record = 0x0200; // Record identifier $record = 0x0200; // Record identifier
$row_min = $this->_dim_rowmin; // First row $row_min = $this->_dim_rowmin; // First row
$row_max = $this->_dim_rowmax; // Last row plus 1 $row_max = $this->_dim_rowmax + 1; // Last row plus 1
$col_min = $this->_dim_colmin; // First column $col_min = $this->_dim_colmin; // First column
$col_max = $this->_dim_colmax; // Last column plus 1 $col_max = $this->_dim_colmax + 1; // Last column plus 1
$reserved = 0x0000; // Reserved by Excel $reserved = 0x0000; // Reserved by Excel
if ($this->_BIFF_version == 0x0500) { if ($this->_BIFF_version == 0x0500) {
$length = 0x000A; // Number of bytes to follow $length = 0x000A; // Number of bytes to follow