mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-26 07:16:03 +03:00
Bugfix: Workitem 14374 - BUG : Excel5 and setReadFilter ?
Prevent creation of Merged cells unless the read filter permits one or more cells within the range git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@62384 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
parent
58a600b3e3
commit
a73633f130
@ -3817,6 +3817,24 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
|
||||
}
|
||||
}
|
||||
|
||||
private function _includeCellRangeFiltered($cellRangeAddress)
|
||||
{
|
||||
$includeCellRange = true;
|
||||
if (!is_null($this->getReadFilter())) {
|
||||
$includeCellRange = false;
|
||||
$rangeBoundaries = PHPExcel_Cell::getRangeBoundaries($cellRangeAddress);
|
||||
for ($row = $rangeBoundaries[0][1]; $row <= $rangeBoundaries[1][1]; $row++) {
|
||||
for ($column = $rangeBoundaries[0][0]; $column <= $rangeBoundaries[1][0]; $column++) {
|
||||
if ($this->getReadFilter()->readCell($column, $row, $this->_phpSheet->getTitle())) {
|
||||
$includeCellRange = true;
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $includeCellRange;
|
||||
}
|
||||
|
||||
/**
|
||||
* MERGEDCELLS
|
||||
*
|
||||
@ -3837,7 +3855,9 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader
|
||||
if ($this->_version == self::XLS_BIFF8 && !$this->_readDataOnly) {
|
||||
$cellRangeAddressList = $this->_readBIFF8CellRangeAddressList($recordData);
|
||||
foreach ($cellRangeAddressList['cellRangeAddresses'] as $cellRangeAddress) {
|
||||
$this->_phpSheet->mergeCells($cellRangeAddress);
|
||||
if ($this->_includeCellRangeFiltered($cellRangeAddress)) {
|
||||
$this->_phpSheet->mergeCells($cellRangeAddress);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user