Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for #710 #752

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/PhpPresentation/Reader/PowerPoint2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
$oElement = $xmlReader->getElement($pathZoom);
if ($oElement instanceof DOMElement) {
if ($oElement->hasAttribute('d') && $oElement->hasAttribute('n')) {
$this->oPhpPresentation->getPresentationProperties()->setZoom($oElement->getAttribute('n') / $oElement->getAttribute('d'));

Check failure on line 337 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Binary operation "/" between string and string results in an error.

Check failure on line 337 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Binary operation "/" between string and string results in an error.

Check failure on line 337 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Binary operation "/" between string and string results in an error.

Check failure on line 337 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Binary operation "/" between string and string results in an error.

Check failure on line 337 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Binary operation "/" between string and string results in an error.

Check failure on line 337 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Binary operation "/" between string and string results in an error.
}
}
}
Expand Down Expand Up @@ -557,7 +557,7 @@
$oElementLvlDefRPR = $xmlReader->getElement('a:defRPr', $oElementLvl);
if ($oElementLvlDefRPR instanceof DOMElement) {
if ($oElementLvlDefRPR->hasAttribute('sz')) {
$oRTParagraph->getFont()->setSize((int) ($oElementLvlDefRPR->getAttribute('sz') / 100));

Check failure on line 560 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Binary operation "/" between string and 100 results in an error.

Check failure on line 560 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Binary operation "/" between string and 100 results in an error.

Check failure on line 560 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Binary operation "/" between string and 100 results in an error.

Check failure on line 560 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Binary operation "/" between string and 100 results in an error.

Check failure on line 560 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Binary operation "/" between string and 100 results in an error.

Check failure on line 560 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Binary operation "/" between string and 100 results in an error.
}
if ($oElementLvlDefRPR->hasAttribute('b') && 1 == $oElementLvlDefRPR->getAttribute('b')) {
$oRTParagraph->getFont()->setBold(true);
Expand Down Expand Up @@ -883,9 +883,9 @@
$oSlide->addShape($oShape);
}

protected function loadShapeRichText(XMLReader $document, DOMElement $node, AbstractSlide $oSlide): void
protected function loadShapeRichText(XMLReader $document, DOMElement $node, $oSlide): void

Check failure on line 886 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Method PhpOffice\PhpPresentation\Reader\PowerPoint2007::loadShapeRichText() has parameter $oSlide with no type specified.

Check failure on line 886 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Method PhpOffice\PhpPresentation\Reader\PowerPoint2007::loadShapeRichText() has parameter $oSlide with no type specified.

Check failure on line 886 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Method PhpOffice\PhpPresentation\Reader\PowerPoint2007::loadShapeRichText() has parameter $oSlide with no type specified.

Check failure on line 886 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Method PhpOffice\PhpPresentation\Reader\PowerPoint2007::loadShapeRichText() has parameter $oSlide with no type specified.

Check failure on line 886 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Method PhpOffice\PhpPresentation\Reader\PowerPoint2007::loadShapeRichText() has parameter $oSlide with no type specified.

Check failure on line 886 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Method PhpOffice\PhpPresentation\Reader\PowerPoint2007::loadShapeRichText() has parameter $oSlide with no type specified.
{
if (!$document->elementExists('p:txBody/a:p/a:r', $node)) {
if (!$document->elementExists('p:txBody/a:p/a:r', $node) || !$oSlide instanceof AbstractSlide) {
return;
}
// Core
Expand Down Expand Up @@ -1115,20 +1115,20 @@
$oElementLineSpacingPoints = $document->getElement('a:lnSpc/a:spcPts', $oSubElement);
if ($oElementLineSpacingPoints instanceof DOMElement) {
$oParagraph->setLineSpacingMode(Paragraph::LINE_SPACING_MODE_POINT);
$oParagraph->setLineSpacing($oElementLineSpacingPoints->getAttribute('val') / 100);

Check failure on line 1118 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1118 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1118 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1118 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1118 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1118 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Binary operation "/" between string and 100 results in an error.
}
$oElementLineSpacingPercent = $document->getElement('a:lnSpc/a:spcPct', $oSubElement);
if ($oElementLineSpacingPercent instanceof DOMElement) {
$oParagraph->setLineSpacingMode(Paragraph::LINE_SPACING_MODE_PERCENT);
$oParagraph->setLineSpacing($oElementLineSpacingPercent->getAttribute('val') / 1000);

Check failure on line 1123 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1123 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1123 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1123 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1123 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1123 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Binary operation "/" between string and 1000 results in an error.
}
$oElementSpacingBefore = $document->getElement('a:spcBef/a:spcPts', $oSubElement);
if ($oElementSpacingBefore instanceof DOMElement) {
$oParagraph->setSpacingBefore($oElementSpacingBefore->getAttribute('val') / 100);

Check failure on line 1127 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1127 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1127 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1127 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1127 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1127 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Binary operation "/" between string and 100 results in an error.
}
$oElementSpacingAfter = $document->getElement('a:spcAft/a:spcPts', $oSubElement);
if ($oElementSpacingAfter instanceof DOMElement) {
$oParagraph->setSpacingAfter($oElementSpacingAfter->getAttribute('val') / 100);

Check failure on line 1131 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1131 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1131 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1131 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1131 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1131 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Binary operation "/" between string and 100 results in an error.
}

$oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_NONE);
Expand Down Expand Up @@ -1194,7 +1194,7 @@
$oText->getFont()->setStrikethrough('noStrike' == $oElementrPr->getAttribute('strike') ? false : true);
}
if ($oElementrPr->hasAttribute('sz')) {
$oText->getFont()->setSize((int) ($oElementrPr->getAttribute('sz') / 100));

Check failure on line 1197 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1197 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1197 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1197 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1197 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1197 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Binary operation "/" between string and 100 results in an error.
}
if ($oElementrPr->hasAttribute('u')) {
$oText->getFont()->setUnderline($oElementrPr->getAttribute('u'));
Expand Down Expand Up @@ -1264,7 +1264,7 @@
protected function loadStyleBorder(XMLReader $xmlReader, DOMElement $oElement, Border $oBorder): void
{
if ($oElement->hasAttribute('w')) {
$oBorder->setLineWidth((int) ($oElement->getAttribute('w') / 12700));

Check failure on line 1267 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Binary operation "/" between string and 12700 results in an error.

Check failure on line 1267 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Binary operation "/" between string and 12700 results in an error.

Check failure on line 1267 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Binary operation "/" between string and 12700 results in an error.

Check failure on line 1267 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Binary operation "/" between string and 12700 results in an error.

Check failure on line 1267 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Binary operation "/" between string and 12700 results in an error.

Check failure on line 1267 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Binary operation "/" between string and 12700 results in an error.
}
if ($oElement->hasAttribute('cmpd')) {
$oBorder->setLineStyle($oElement->getAttribute('cmpd'));
Expand Down Expand Up @@ -1292,7 +1292,7 @@
$oColor->setRGB($oElement->getAttribute('val'));
$oElementAlpha = $xmlReader->getElement('a:alpha', $oElement);
if ($oElementAlpha instanceof DOMElement && $oElementAlpha->hasAttribute('val')) {
$alpha = strtoupper(dechex((($oElementAlpha->getAttribute('val') / 1000) / 100) * 255));

Check failure on line 1295 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1295 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1295 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1295 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1295 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1295 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Binary operation "/" between string and 1000 results in an error.
$oColor->setRGB($oElement->getAttribute('val'), $alpha);
}

Expand Down
2 changes: 1 addition & 1 deletion src/PhpPresentation/Style/Border.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function getLineWidth(): int
*/
public function setLineWidth(int $pValue = 1): self
{
$this->lineWidth = $pValue;
$this->lineWidth = (int) $pValue;

return $this;
}
Expand Down
Loading