diff --git a/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php b/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php index 5f6cb4dc..80361371 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php +++ b/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php @@ -45,6 +45,7 @@ class ConditionalStyles || (string) $cfRule['type'] == Conditional::CONDITION_CONTAINSTEXT || (string) $cfRule['type'] == Conditional::CONDITION_CONTAINSBLANKS || (string) $cfRule['type'] == Conditional::CONDITION_NOTCONTAINSBLANKS + || (string) $cfRule['type'] == Conditional::CONDITION_NOTCONTAINSTEXT || (string) $cfRule['type'] == Conditional::CONDITION_EXPRESSION) && isset($this->dxfs[(int) ($cfRule['dxfId'])]) ) { diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx/ConditionalTest.php b/tests/PhpSpreadsheetTests/Reader/Xlsx/ConditionalTest.php new file mode 100644 index 00000000..6ee7bc37 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Reader/Xlsx/ConditionalTest.php @@ -0,0 +1,31 @@ +load($filename); + $worksheet = $spreadsheet->getActiveSheet(); + $styles = $worksheet->getConditionalStyles('A1:A5'); + + $this->assertCount(1, $styles); + + /** @var $notContainsTextStyle Conditional */ + $notContainsTextStyle = $styles[0]; + $this->assertEquals('A', $notContainsTextStyle->getText()); + $this->assertEquals(Conditional::CONDITION_NOTCONTAINSTEXT, $notContainsTextStyle->getConditionType()); + $this->assertEquals(Conditional::OPERATOR_NOTCONTAINS, $notContainsTextStyle->getOperatorType()); + } +} diff --git a/tests/data/Reader/XLSX/conditionalFormatting3Test.xlsx b/tests/data/Reader/XLSX/conditionalFormatting3Test.xlsx new file mode 100644 index 00000000..ee23e21c Binary files /dev/null and b/tests/data/Reader/XLSX/conditionalFormatting3Test.xlsx differ