[FIXED] Wrong use of passing by reference.

This commit is contained in:
Roman Syroeshko 2014-07-04 16:20:18 +04:00
parent f2c4329108
commit fd209fc999

View File

@ -166,13 +166,15 @@ abstract class AbstractPart
if ($runLinkCount == 0) { if ($runLinkCount == 0) {
$parent->addTextBreak(null, $paragraphStyle); $parent->addTextBreak(null, $paragraphStyle);
} else { } else {
$textParent = $parent;
if ($runLinkCount > 1) {
$textParent = $parent->addTextRun($paragraphStyle);
}
$nodes = $xmlReader->getElements('*', $domNode); $nodes = $xmlReader->getElements('*', $domNode);
foreach ($nodes as $node) { foreach ($nodes as $node) {
$this->readRun($xmlReader, $node, $textParent, $docPart, $paragraphStyle); $this->readRun(
$xmlReader,
$node,
($runLinkCount > 1) ? $parent->addTextRun($paragraphStyle) : $parent,
$docPart,
$paragraphStyle
);
} }
} }
} }