Error style of data validation was incorrectly written to Xls
We use to write the wrong property to file, leading to a warning in PHP 7.1 since the `switch` never matched anything and the variable was left as a string instead of as an int. Closes https://github.com/PHPOffice/PHPExcel/issues/1110
This commit is contained in:
parent
714dc29890
commit
c2b38b0ee0
|
@ -84,7 +84,7 @@ class DataValidation
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
private $operator = '';
|
||||
private $operator = self::OPERATOR_BETWEEN;
|
||||
|
||||
/**
|
||||
* Allow Blank.
|
||||
|
|
|
@ -2838,11 +2838,10 @@ class Worksheet extends BIFFwriter
|
|||
break;
|
||||
}
|
||||
|
||||
$type = (int) $type;
|
||||
$options |= $type << 0;
|
||||
|
||||
// error style
|
||||
$errorStyle = $dataValidation->getType();
|
||||
$errorStyle = $dataValidation->getErrorStyle();
|
||||
switch ($errorStyle) {
|
||||
case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_STOP:
|
||||
$errorStyle = 0x00;
|
||||
|
@ -2855,7 +2854,6 @@ class Worksheet extends BIFFwriter
|
|||
break;
|
||||
}
|
||||
|
||||
$errorStyle = (int) $errorStyle;
|
||||
$options |= $errorStyle << 4;
|
||||
|
||||
// explicit formula?
|
||||
|
@ -2904,7 +2902,6 @@ class Worksheet extends BIFFwriter
|
|||
break;
|
||||
}
|
||||
|
||||
$operator = (int) $operator;
|
||||
$options |= $operator << 20;
|
||||
|
||||
$data = pack('V', $options);
|
||||
|
|
Loading…
Reference in New Issue