Skip to content

Commit 474d360

Browse files
author
Bas-Jan 't Jong
committed
Fixed a bug in TextBox; addText to a TextBox was treated 'withoutP'.
This is not the expected behaviour
1 parent 841bc2a commit 474d360

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/PhpWord/Writer/Word2007/Element/TextBox.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ public function write()
5757
$margins = implode(', ', $tbxStyle->getInnerMargin());
5858
$this->xmlWriter->writeAttribute('inset', $margins);
5959
$this->xmlWriter->startElement('w:txbxContent');
60-
$this->xmlWriter->startElement('w:p');
6160
$this->parentWriter->writeContainerElements($this->xmlWriter, $this->element);
62-
$this->xmlWriter->endElement(); // w:p
6361
$this->xmlWriter->endElement(); // w:txbxContent
6462
$this->xmlWriter->endElement(); // v: textbox
6563
$styleWriter->writeW10Wrap();

src/PhpWord/Writer/Word2007/Part/AbstractPart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function writeContainerElements(XMLWriter $xmlWriter, AbstractElement $co
110110

111111
// Loop through elements
112112
$elements = $container->getElements();
113-
$withoutP = in_array($containerName, array('TextRun', 'Footnote', 'Endnote', 'TextBox')) ? true : false;
113+
$withoutP = in_array($containerName, array('TextRun', 'Footnote', 'Endnote')) ? true : false;
114114
if (count($elements) > 0) {
115115
foreach ($elements as $element) {
116116
if ($element instanceof AbstractElement) {

0 commit comments

Comments
 (0)