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