Fixed issue #14281: Using a row > 16,384 reports an error even though the BIFF8 format should support it

git-svn-id: https://svn.php.net/repository/pear/packages/Spreadsheet_Excel_Writer/trunk@291404 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Carsten Schmitz 2009-11-29 00:25:36 +00:00
parent a601cb0de2
commit 9a6a1f6a91
1 changed files with 11 additions and 5 deletions

View File

@ -988,6 +988,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
/** /**
* pack() row and column into the required 3 or 4 byte format. * pack() row and column into the required 3 or 4 byte format.
* If col or row exceeds valid format bounds the maximum row/col will be used
* *
* @access private * @access private
* @param string $cell The Excel cell reference to be packed * @param string $cell The Excel cell reference to be packed
@ -997,13 +998,18 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
{ {
$cell = strtoupper($cell); $cell = strtoupper($cell);
list($row, $col, $row_rel, $col_rel) = $this->_cellToRowcol($cell); list($row, $col, $row_rel, $col_rel) = $this->_cellToRowcol($cell);
if ($col >= 256) {
return $this->raiseError("Column in: $cell greater than 255"); if ($col > 255) {
$col=255;
} }
// FIXME: change for BIFF8 if ($row > 16383 && $this->_BIFF_version == 0x0500) {
if ($row >= 16384) { $row=16383;
return $this->raiseError("Row in: $cell greater than 16384 ");
} }
elseif ($row > 65535 && $this->_BIFF_version == 0x0600) {
$row=65535;
}
// Set the high bits to indicate if row or col are relative. // Set the high bits to indicate if row or col are relative.
if ($this->_BIFF_version == 0x0500) { if ($this->_BIFF_version == 0x0500) {