From f2e9e3716b2266e07d6a0b33d9d99fce7c95bde7 Mon Sep 17 00:00:00 2001 From: Roman Syroeshko Date: Fri, 4 Jul 2014 13:00:52 +0400 Subject: [PATCH] [FIXED] Wrong use of passing by reference. --- src/PhpWord/Reader/Word2007/AbstractPart.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/PhpWord/Reader/Word2007/AbstractPart.php b/src/PhpWord/Reader/Word2007/AbstractPart.php index eead400f..d63a65ad 100644 --- a/src/PhpWord/Reader/Word2007/AbstractPart.php +++ b/src/PhpWord/Reader/Word2007/AbstractPart.php @@ -166,15 +166,15 @@ abstract class AbstractPart if ($runLinkCount == 0) { $parent->addTextBreak(null, $paragraphStyle); } else { - if ($runLinkCount > 1) { - $textrun = $parent->addTextRun($paragraphStyle); - $textParent = &$textrun; - } else { - $textParent = &$parent; - } $nodes = $xmlReader->getElements('*', $domNode); foreach ($nodes as $node) { - $this->readRun($xmlReader, $node, $textParent, $docPart, $paragraphStyle); + $this->readRun( + $xmlReader, + $node, + ($runLinkCount > 1) ? $parent->addTextRun($paragraphStyle) : $parent, + $docPart, + $paragraphStyle + ); } } }