Skip to content

Commit

Permalink
Fixed CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 committed Dec 1, 2023
1 parent 1d5b988 commit 06a4514
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 25 deletions.
10 changes: 7 additions & 3 deletions docs/changes/1.1.0.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# 1.0.0 - WIP
# 1.1.0 - WIP

## Features

- Support for axis options - [@mindline](https://github.com/mindline-analytics) GH-676
- Support for axis options - [@mindline](https://github.com/mindline-analytics) in [#676](https://github.com/PHPOffice/PHPPresentatio /pull/676)
- Axis intersection point (axis crossing) through `setCrossesAt`/ `getCrossesAt`
- Reverse axis order through `setIsReversedOrder`/ `isReversedOrder`
- PowerPoint2007 Writer
- Support for Hyperlink Text Color - [@MartynasJanu](https://github.com/MartynasJanu) & [@Progi1984](https://github.com/Progi1984) GH-682
- Support for Hyperlink Text Color - [@MartynasJanu](https://github.com/MartynasJanu) & [@Progi1984](https://github.com/Progi1984) in [#682](https://github.com/PHPOffice/PHPPresentatio /pull/682)
- PowerPoint2007 Reader
- PowerPoint2007 Writer

## Bugfixes

- Fixed CI - [@Progi1984](https://github.com/Progi1984) in [#766](https://github.com/PHPOffice/PHPPresentatio /pull/766)
18 changes: 9 additions & 9 deletions src/PhpPresentation/Reader/PowerPoint2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ protected function loadViewProperties(string $sPart): void
$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'));
$this->oPhpPresentation->getPresentationProperties()->setZoom((int) $oElement->getAttribute('n') / (int) $oElement->getAttribute('d'));
}
}
}
Expand Down Expand Up @@ -557,7 +557,7 @@ protected function loadMasterSlide(string $sPart, string $baseFile): void
$oElementLvlDefRPR = $xmlReader->getElement('a:defRPr', $oElementLvl);
if ($oElementLvlDefRPR instanceof DOMElement) {
if ($oElementLvlDefRPR->hasAttribute('sz')) {
$oRTParagraph->getFont()->setSize((int) ($oElementLvlDefRPR->getAttribute('sz') / 100));
$oRTParagraph->getFont()->setSize(intval((int) $oElementLvlDefRPR->getAttribute('sz') / 100));
}
if ($oElementLvlDefRPR->hasAttribute('b') && 1 == $oElementLvlDefRPR->getAttribute('b')) {
$oRTParagraph->getFont()->setBold(true);
Expand Down Expand Up @@ -1115,20 +1115,20 @@ protected function loadParagraph(XMLReader $document, DOMElement $oElement, $oSh
$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);
$oParagraph->setLineSpacing((int) $oElementLineSpacingPoints->getAttribute('val') / 100);
}
$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);
$oParagraph->setLineSpacing((int) $oElementLineSpacingPercent->getAttribute('val') / 1000);
}
$oElementSpacingBefore = $document->getElement('a:spcBef/a:spcPts', $oSubElement);
if ($oElementSpacingBefore instanceof DOMElement) {
$oParagraph->setSpacingBefore($oElementSpacingBefore->getAttribute('val') / 100);
$oParagraph->setSpacingBefore((int) $oElementSpacingBefore->getAttribute('val') / 100);
}
$oElementSpacingAfter = $document->getElement('a:spcAft/a:spcPts', $oSubElement);
if ($oElementSpacingAfter instanceof DOMElement) {
$oParagraph->setSpacingAfter($oElementSpacingAfter->getAttribute('val') / 100);
$oParagraph->setSpacingAfter((int) $oElementSpacingAfter->getAttribute('val') / 100);
}

$oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_NONE);
Expand Down Expand Up @@ -1194,7 +1194,7 @@ protected function loadParagraph(XMLReader $document, DOMElement $oElement, $oSh
$oText->getFont()->setStrikethrough('noStrike' == $oElementrPr->getAttribute('strike') ? false : true);
}
if ($oElementrPr->hasAttribute('sz')) {
$oText->getFont()->setSize((int) ($oElementrPr->getAttribute('sz') / 100));
$oText->getFont()->setSize(intval((int) $oElementrPr->getAttribute('sz') / 100));
}
if ($oElementrPr->hasAttribute('u')) {
$oText->getFont()->setUnderline($oElementrPr->getAttribute('u'));
Expand Down Expand Up @@ -1264,7 +1264,7 @@ protected function loadHyperlink(XMLReader $xmlReader, DOMElement $element, Hype
protected function loadStyleBorder(XMLReader $xmlReader, DOMElement $oElement, Border $oBorder): void
{
if ($oElement->hasAttribute('w')) {
$oBorder->setLineWidth((int) ($oElement->getAttribute('w') / 12700));
$oBorder->setLineWidth(intval((int) $oElement->getAttribute('w') / 12700));
}
if ($oElement->hasAttribute('cmpd')) {
$oBorder->setLineStyle($oElement->getAttribute('cmpd'));
Expand Down Expand Up @@ -1292,7 +1292,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((($oElementAlpha->getAttribute('val') / 1000) / 100) * 255));
$alpha = strtoupper(dechex((((int) $oElementAlpha->getAttribute('val') / 1000) / 100) * 255));
$oColor->setRGB($oElement->getAttribute('val'), $alpha);
}

Expand Down
13 changes: 6 additions & 7 deletions src/PhpPresentation/Reader/PowerPoint97.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,11 @@ private function loadPicturesStream(): void
// OfficeArtFBSE
throw new FeatureNotImplementedException();
}
if ($arrayRH['recType'] >= 0xF018 && $arrayRH['recType'] <= 0xF117) {
$arrayRecord = $this->readRecordOfficeArtBlip($stream, $pos - 8);
if ($arrayRecord['length'] > 0) {
$pos += $arrayRecord['length'];
$this->arrayPictures[] = $arrayRecord['picture'];
}
// $arrayRH['recType'] >= 0xF018 && $arrayRH['recType'] <= 0xF117
$arrayRecord = $this->readRecordOfficeArtBlip($stream, $pos - 8);
if ($arrayRecord['length'] > 0) {
$pos += $arrayRecord['length'];
$this->arrayPictures[] = $arrayRecord['picture'];
}
$readSuccess = true;
}
Expand Down Expand Up @@ -535,7 +534,7 @@ private function loadCurrentUserStream(): void
// headerToken
$headerToken = self::getInt4d($this->streamCurrentUser, $pos);
$pos += 4;
if (0xF3D1C4DF == $headerToken && 0xE391C05F != $headerToken) {
if (0xF3D1C4DF == $headerToken) {
// Encrypted file
throw new FeatureNotImplementedException();
}
Expand Down
8 changes: 4 additions & 4 deletions src/PhpPresentation/Shape/Chart/Series.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Series implements ComparableInterface
*
* @var string
*/
protected $DlblNumFormat = '';
protected $dlblNumFormat = '';

/**
* @var string|null
Expand Down Expand Up @@ -184,23 +184,23 @@ public function setTitle(string $value = 'Series Title'): self
*/
public function getDlblNumFormat(): string
{
return $this->DlblNumFormat;
return $this->dlblNumFormat;
}

/**
* Has Data Label NumFormat.
*/
public function hasDlblNumFormat(): bool
{
return !empty($this->DlblNumFormat);
return !empty($this->dlblNumFormat);
}

/**
* Set Data Label NumFormat.
*/
public function setDlblNumFormat(string $value = ''): self
{
$this->DlblNumFormat = $value;
$this->dlblNumFormat = $value;

return $this;
}
Expand Down
2 changes: 2 additions & 0 deletions src/PhpPresentation/Slide/Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public function rewind()
*
* @return \PhpOffice\PhpPresentation\Slide
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->subject->getSlide($this->position);
Expand All @@ -80,6 +81,7 @@ public function current()
*
* @return int
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->position;
Expand Down
2 changes: 1 addition & 1 deletion src/PhpPresentation/Writer/ODPresentation/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ protected function writeShapeTxt(XMLWriter $objWriter, RichText $shape): void
} elseif ('bullet' == $paragraph->getBulletStyle()->getBulletType()) {
$bCstShpHasBullet = true;
// Open the bullet list
if ('bullet' != $sCstShpLastBullet || ($sCstShpLastBullet == $paragraph->getBulletStyle()->getBulletType() && $iCstShpLastBulletLvl < $paragraph->getAlignment()->getLevel())) {
if ('bullet' != $sCstShpLastBullet || $iCstShpLastBulletLvl < $paragraph->getAlignment()->getLevel()) {
// text:list
$objWriter->startElement('text:list');
$objWriter->writeAttribute('text:style-name', 'L_' . $paragraph->getBulletStyle()->getHashCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ public function testRichTextShadow(): void
if (0 == $inc || 180 == $inc || 360 == $inc) {
$this->assertZipXmlAttributeEquals('content.xml', $element, 'draw:shadow-offset-y', '0cm');
} else {
if (($inc > 0 && $inc < 180) || 360 == $inc) {
if ($inc < 180) {
$this->assertZipXmlAttributeEquals('content.xml', $element, 'draw:shadow-offset-y', Drawing::pixelsToCentimeters((int) $randDistance) . 'cm');
} else {
$this->assertZipXmlAttributeEquals('content.xml', $element, 'draw:shadow-offset-y', '-' . Drawing::pixelsToCentimeters((int) $randDistance) . 'cm');
Expand Down

0 comments on commit 06a4514

Please sign in to comment.