Skip to content

Commit 487622b

Browse files
authored
Merge pull request #1637 from bhattnishant/master
To support PreserveText inside sub container
2 parents fa6a80f + d7ed18c commit 487622b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/PhpWord/Element/AbstractContainer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ private function checkValidity($method)
254254
// Special condition, e.g. preservetext can only exists in cell when
255255
// the cell is located in header or footer
256256
$validSubcontainers = array(
257-
'PreserveText' => array(array('Cell'), array('Header', 'Footer')),
257+
'PreserveText' => array(array('Cell'), array('Header', 'Footer', 'Section')),
258258
'Footnote' => array(array('Cell', 'TextRun'), array('Section')),
259259
'Endnote' => array(array('Cell', 'TextRun'), array('Section')),
260260
);

tests/PhpWord/Element/CellTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public function testAddPreserveTextNotUTF8()
233233
public function testAddPreserveTextException()
234234
{
235235
$oCell = new Cell();
236-
$oCell->setDocPart('Section', 1);
236+
$oCell->setDocPart('TextRun', 1);
237237
$oCell->addPreserveText('text');
238238
}
239239

0 commit comments

Comments
 (0)