PhpOffice\PhpPresentation\Reader\ODPresentation::readParagraphItem PHP Method

readParagraphItem() protected method

Read Paragraph Item
protected readParagraphItem ( Paragraph $oParagraph, DOMElement $oNodeParent )
$oParagraph PhpOffice\PhpPresentation\Shape\RichText\Paragraph
$oNodeParent DOMElement
    protected function readParagraphItem(Paragraph $oParagraph, \DOMElement $oNodeParent)
    {
        if ($this->oXMLReader->elementExists('text:line-break', $oNodeParent)) {
            $oParagraph->createBreak();
        } else {
            $oTextRun = $oParagraph->createTextRun();
            if ($oNodeParent->hasAttribute('text:style-name')) {
                $keyStyle = $oNodeParent->getAttribute('text:style-name');
                if (isset($this->arrayStyles[$keyStyle])) {
                    $oTextRun->setFont($this->arrayStyles[$keyStyle]['font']);
                }
            }
            if ($oTextRunLink = $this->oXMLReader->getElement('text:a', $oNodeParent)) {
                $oTextRun->setText($oTextRunLink->nodeValue);
                if ($oTextRunLink->hasAttribute('xlink:href')) {
                    $oTextRun->getHyperlink()->setUrl($oTextRunLink->getAttribute('xlink:href'));
                }
            } else {
                $oTextRun->setText($oNodeParent->nodeValue);
            }
        }
    }