Change how ReadFilters are interpreted

This commit is contained in:
Alex Wright 2020-12-13 15:29:18 +01:00
parent 37bf44e9db
commit f366c0f257
1 changed files with 12 additions and 6 deletions

View File

@ -121,13 +121,16 @@ class ColumnAndRowAttributes extends BaseParserClass
private function isFilteredColumn(IReadFilter $readFilter, $columnCoordinate, array $rowsAttributes)
{
if (empty($rowAttributes)) {
return false;
}
foreach ($rowsAttributes as $rowCoordinate => $rowAttributes) {
if (!$readFilter->readCell($columnCoordinate, $rowCoordinate, $this->worksheet->getTitle())) {
return true;
if ($readFilter->readCell($columnCoordinate, $rowCoordinate, $this->worksheet->getTitle())) {
return false;
}
}
return false;
return true;
}
private function readColumnAttributes(SimpleXMLElement $worksheetCols, $readDataOnly)
@ -173,13 +176,16 @@ class ColumnAndRowAttributes extends BaseParserClass
private function isFilteredRow(IReadFilter $readFilter, $rowCoordinate, array $columnsAttributes)
{
if (empty($columnAttributes)) {
return false;
}
foreach ($columnsAttributes as $columnCoordinate => $columnAttributes) {
if (!$readFilter->readCell($columnCoordinate, $rowCoordinate, $this->worksheet->getTitle())) {
return true;
if ($readFilter->readCell($columnCoordinate, $rowCoordinate, $this->worksheet->getTitle())) {
return false;
}
}
return false;
return true;
}
private function readRowAttributes(SimpleXMLElement $worksheetRow, $readDataOnly)