Skip to content

Commit 7c8cfb7

Browse files
AntonioMalatestatroosan
authored andcommitted
Adding condition for document template saving using libreoffice
When I save document template with libreoffice (in .docx format) the cloneRow with nested table doesn't work. The problem is that the regular expression, that used for search if row is no longer part of the spanned row, was wrong: <w:vMerge w:val="continue" /> became <w:vMerge w:val="continue"/> without space at the closure tag. Sorry for my English.
1 parent b2c627d commit 7c8cfb7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PhpWord/TemplateProcessor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,8 @@ public function cloneRow($search, $numberOfClones)
612612
// If tmpXmlRow doesn't contain continue, this row is no longer part of the spanned row.
613613
$tmpXmlRow = $this->getSlice($extraRowStart, $extraRowEnd);
614614
if (!preg_match('#<w:vMerge/>#', $tmpXmlRow) &&
615-
!preg_match('#<w:vMerge w:val="continue" />#', $tmpXmlRow)) {
615+
!preg_match('#<w:vMerge w:val="continue" />#', $tmpXmlRow) &&
616+
!preg_match('#<w:vMerge w:val="continue"/>#', $tmpXmlRow)) {
616617
break;
617618
}
618619
// This row was a spanned row, update $rowEnd and search for the next row.

0 commit comments

Comments
 (0)