diff --git a/src/PhpWord/Reader/Word2007/AbstractPart.php b/src/PhpWord/Reader/Word2007/AbstractPart.php index 7d4209953b..df3cfed709 100644 --- a/src/PhpWord/Reader/Word2007/AbstractPart.php +++ b/src/PhpWord/Reader/Word2007/AbstractPart.php @@ -558,7 +558,7 @@ private function readCellStyle(XMLReader $xmlReader, DOMElement $domNode) 'valign' => [self::READ_VALUE, 'w:vAlign'], 'textDirection' => [self::READ_VALUE, 'w:textDirection'], 'gridSpan' => [self::READ_VALUE, 'w:gridSpan'], - 'vMerge' => [self::READ_VALUE, 'w:vMerge'], + 'vMerge' => [self::READ_VALUE, 'w:vMerge', null, null, 'continue'], 'bgColor' => [self::READ_VALUE, 'w:shd', 'w:fill'], ]; @@ -626,7 +626,7 @@ protected function readStyleDefs(XMLReader $xmlReader, ?DOMElement $parentNode = $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 @@ protected function readStyleDefs(XMLReader $xmlReader, ?DOMElement $parentNode = // 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) {