Skip to content

Commit be49938

Browse files
authored
Merge pull request #2336 from kernusr/read-empty-vmerge
Word2007 : Read empty vmerge
2 parents 20f3a3e + b457ff5 commit be49938

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/PhpWord/Reader/Word2007/AbstractPart.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ private function readCellStyle(XMLReader $xmlReader, DOMElement $domNode)
558558
'valign' => [self::READ_VALUE, 'w:vAlign'],
559559
'textDirection' => [self::READ_VALUE, 'w:textDirection'],
560560
'gridSpan' => [self::READ_VALUE, 'w:gridSpan'],
561-
'vMerge' => [self::READ_VALUE, 'w:vMerge'],
561+
'vMerge' => [self::READ_VALUE, 'w:vMerge', null, null, 'continue'],
562562
'bgColor' => [self::READ_VALUE, 'w:shd', 'w:fill'],
563563
];
564564

@@ -626,7 +626,7 @@ protected function readStyleDefs(XMLReader $xmlReader, ?DOMElement $parentNode =
626626
$styles = [];
627627

628628
foreach ($styleDefs as $styleProp => $styleVal) {
629-
[$method, $element, $attribute, $expected] = array_pad($styleVal, 4, null);
629+
[$method, $element, $attribute, $expected, $default] = array_pad($styleVal, 5, null);
630630

631631
$element = $this->findPossibleElement($xmlReader, $parentNode, $element);
632632
if ($element === null) {
@@ -640,7 +640,7 @@ protected function readStyleDefs(XMLReader $xmlReader, ?DOMElement $parentNode =
640640

641641
// Use w:val as default if no attribute assigned
642642
$attribute = ($attribute === null) ? 'w:val' : $attribute;
643-
$attributeValue = $xmlReader->getAttribute($attribute, $node);
643+
$attributeValue = $xmlReader->getAttribute($attribute, $node) ?? $default;
644644

645645
$styleValue = $this->readStyleDef($method, $attributeValue, $expected);
646646
if ($styleValue !== null) {

0 commit comments

Comments
 (0)