Fix to dynamic autofilter expression in writer, preventing writing

blanks="1"
This commit is contained in:
Mark Baker 2012-08-16 00:29:07 +01:00
parent 83afa87bf3
commit bb0d413a67
2 changed files with 6 additions and 1 deletions

View File

@ -451,12 +451,16 @@ var_dump($ruleValue);
);
break;
case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER :
$ruleValues = array();
$columnFilterTests[$columnID] = array(
'method' => '_filterTypeDynamicFilters',
'arguments' => $ruleValues
);
break;
case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER :
$ruleValues = array();
$columnFilterTests[$columnID] = array(
'method' => '_filterTypeTopTenFilters',
'arguments' => $ruleValues

View File

@ -765,7 +765,8 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
}
foreach ($rules as $rule) {
if (($rule->getOperator() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL) &&
if (($column->getFilterType() === PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER) &&
($rule->getOperator() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL) &&
($rule->getValue() === '')) {
// Filter rule for Blanks
$objWriter->writeAttribute('blank', 1);