Bugfix: Work item GH-66 - Wrong check for maximum number of rows in Excel5 Writer

This commit is contained in:
Mark Baker 2012-10-25 12:57:48 +01:00
parent 701ff5adf1
commit 45f2829a33
4 changed files with 10 additions and 11 deletions

View File

@ -493,14 +493,13 @@ class PHPExcel_Shared_String
public static function ConvertEncoding($value, $to, $from)
{
if (self::getIsIconvEnabled()) {
$value = iconv($from, $to, $value);
return $value;
return iconv($from, $to, $value);
}
if (self::getIsMbstringEnabled()) {
$value = mb_convert_encoding($value, $to, $from);
return $value;
return mb_convert_encoding($value, $to, $from);
}
if($from == 'UTF-16LE'){
return self::utf16_decode($value, false);
}else if($from == 'UTF-16BE'){

View File

@ -944,9 +944,8 @@ class PHPExcel_Writer_Excel5_Parser
if ($col >= 256) {
throw new Exception("Column in: $cell greater than 255");
}
// FIXME: change for BIFF8
if ($row >= 16384) {
throw new Exception("Row in: $cell greater than 16384 ");
if ($row >= 65536) {
throw new Exception("Row in: $cell greater than 65536 ");
}
// Set the high bits to indicate if row or col are relative.
@ -980,11 +979,11 @@ class PHPExcel_Writer_Excel5_Parser
--$row2;
// Trick poor inocent Excel
$col1 = 0;
$col2 = 16383; // FIXME: maximum possible value for Excel 5 (change this!!!)
$col2 = 65535; // FIXME: maximum possible value for Excel 5 (change this!!!)
// FIXME: this changes for BIFF8
if (($row1 >= 16384) or ($row2 >= 16384)) {
throw new Exception("Row in: $range greater than 16384 ");
if (($row1 >= 65536) or ($row2 >= 65536)) {
throw new Exception("Row in: $range greater than 65536 ");
}
// Set the high bits to indicate if rows are relative.

View File

@ -629,7 +629,7 @@ class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter
$rowmax = $repeat[1] - 1;
} else {
$rowmin = 0;
$rowmax = 16383;
$rowmax = 65535;
}
$this->_writeNameShort(

View File

@ -26,6 +26,7 @@
Fixed in develop branch:
- Bugfix: (Asker) Work item 18777 - Error in PHPEXCEL/Calculation.php script on line 2976 (stack pop check)
- Bugfix: (MBaker) Work item 18794 - CSV files without a file extension being identified as HTML
- Bugfix: (MBaker) Work item GH-66 - Wrong check for maximum number of rows in Excel5 Writer
--------------------------------------------------------------------------------