From 7c8cfb7b8af351cd400975d715d639c1b7fd26de Mon Sep 17 00:00:00 2001 From: Antonio Malatesta Date: Wed, 1 Apr 2015 16:53:56 +0200 Subject: [PATCH] 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: became without space at the closure tag. Sorry for my English. --- src/PhpWord/TemplateProcessor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php index 63c55e10..fe342bcc 100644 --- a/src/PhpWord/TemplateProcessor.php +++ b/src/PhpWord/TemplateProcessor.php @@ -612,7 +612,8 @@ class TemplateProcessor // If tmpXmlRow doesn't contain continue, this row is no longer part of the spanned row. $tmpXmlRow = $this->getSlice($extraRowStart, $extraRowEnd); if (!preg_match('##', $tmpXmlRow) && - !preg_match('##', $tmpXmlRow)) { + !preg_match('##', $tmpXmlRow) && + !preg_match('##', $tmpXmlRow)) { break; } // This row was a spanned row, update $rowEnd and search for the next row.