set default value on empty value attribute
This commit is contained in:
parent
0af4ca1f6e
commit
573f1c3ea1
@ -626,7 +626,7 @@ abstract class AbstractPart
|
||||
$styles = [];
|
||||
|
||||
foreach ($styleDefs as $styleProp => $styleVal) {
|
||||
[$method, $element, $attribute, $expected] = array_pad($styleVal, 4, null);
|
||||
[$method, $element, $attribute, $expected, $default] = array_pad($styleVal, 5, null);
|
||||
|
||||
$element = $this->findPossibleElement($xmlReader, $parentNode, $element);
|
||||
if ($element === null) {
|
||||
@ -640,7 +640,7 @@ abstract class AbstractPart
|
||||
|
||||
// Use w:val as default if no attribute assigned
|
||||
$attribute = ($attribute === null) ? 'w:val' : $attribute;
|
||||
$attributeValue = $xmlReader->getAttribute($attribute, $node);
|
||||
$attributeValue = $xmlReader->getAttribute($attribute, $node) ?? $default;
|
||||
|
||||
$styleValue = $this->readStyleDef($method, $attributeValue, $expected);
|
||||
if ($styleValue !== null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user