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

Fixed the issue of casts not getting the whole expression #827

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions src/PhpPresentation/Reader/PowerPoint2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,9 @@ protected function loadShapeDrawing(XMLReader $document, DOMElement $node, Abstr
if (!empty($imageFile)) {
if ($oShape instanceof Gd) {
$info = getimagesizefromstring($imageFile);
if (!$info) {
return;
}
$oShape->setMimeType($info['mime']);
$oShape->setRenderingFunction(str_replace('/', '', $info['mime']));
$image = @imagecreatefromstring($imageFile);
Expand Down Expand Up @@ -1214,11 +1217,11 @@ protected function loadParagraph(XMLReader $document, DOMElement $oElement, $oSh
}
$oElementSpacingBefore = $document->getElement('a:spcBef/a:spcPts', $oSubElement);
if ($oElementSpacingBefore instanceof DOMElement) {
$oParagraph->setSpacingBefore((int) ((int) $oElementSpacingBefore->getAttribute('val') / 100));
$oParagraph->setSpacingBefore((int)((int)$oElementSpacingBefore->getAttribute('val') / 100));
}
$oElementSpacingAfter = $document->getElement('a:spcAft/a:spcPts', $oSubElement);
if ($oElementSpacingAfter instanceof DOMElement) {
$oParagraph->setSpacingAfter((int) ((int) $oElementSpacingAfter->getAttribute('val') / 100));
$oParagraph->setSpacingAfter((int)((int)$oElementSpacingAfter->getAttribute('val') / 100));
}

$oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_NONE);
Expand Down Expand Up @@ -1404,7 +1407,7 @@ protected function loadStyleColor(XMLReader $xmlReader, DOMElement $oElement): C
$oColor->setRGB($oElement->getAttribute('val'));
$oElementAlpha = $xmlReader->getElement('a:alpha', $oElement);
if ($oElementAlpha instanceof DOMElement && $oElementAlpha->hasAttribute('val')) {
$alpha = strtoupper(dechex((((int) $oElementAlpha->getAttribute('val') / 1000) / 100) * 255));
$alpha = strtoupper(dechex((int)((((int)$oElementAlpha->getAttribute('val')) / 1000) / 100) * 255));
$oColor->setRGB($oElement->getAttribute('val'), $alpha);
}

Expand Down
4 changes: 0 additions & 4 deletions src/PhpPresentation/Style/Font.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ public function getPanose(): string
*/
public function setPanose(string $pValue): self
{
if (mb_strlen($pValue) !== 10) {
throw new InvalidParameterException('pValue', $pValue, 'The length is not equals to 10');
}

$allowedChars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
foreach (mb_str_split($pValue) as $char) {
if (!in_array($char, $allowedChars)) {
Expand Down
Loading