Skip to content

Commit

Permalink
Merge pull request #770 from Progi1984/pr761
Browse files Browse the repository at this point in the history
Fixed broken powerpoint presentations due to MS Office update 2309
  • Loading branch information
Progi1984 authored Dec 4, 2023
2 parents 273e776 + c858a7b commit f6f0120
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions docs/changes/1.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
- Support for Hyperlink Text Color - [@MartynasJanu](https://github.com/MartynasJanu) & [@Progi1984](https://github.com/Progi1984) in [#682](https://github.com/PHPOffice/PHPPresentation/pull/682)
- PowerPoint2007 Reader
- PowerPoint2007 Writer
- Added support for PHP 8.2 & 8.3 - [@Progi1984](https://github.com/Progi1984) in [#766](https://github.com/PHPOffice/PHPPresentation/pull/766)
- Added support for PHP 8.2 & 8.3 - [@Progi1984](https://github.com/Progi1984) in [#769](https://github.com/PHPOffice/PHPPresentation/pull/769)

## Bugfixes

- Fixed CI - [@Progi1984](https://github.com/Progi1984) in [#766](https://github.com/PHPOffice/PHPPresentation/pull/766)
- Fixed CI - [@Progi1984](https://github.com/Progi1984) in [#766](https://github.com/PHPOffice/PHPPresentation/pull/766)
- Fixed broken PPT Presentations due to MS Office update 2309 - [@WFarmerEthisphere](https://github.com/WFarmerEthisphere) in [#770](https://github.com/PHPOffice/PHPPresentation/pull/770)
6 changes: 4 additions & 2 deletions src/PhpPresentation/Shape/Chart/Axis.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class Axis implements ComparableInterface
public const CROSSES_MIN = 'min';
public const CROSSES_MAX = 'max';

public const DEFAULT_FORMAT_CODE = 'general';

/**
* Title.
*
Expand All @@ -58,7 +60,7 @@ class Axis implements ComparableInterface
*
* @var string
*/
private $formatCode = '';
private $formatCode = self::DEFAULT_FORMAT_CODE;

/**
* Font.
Expand Down Expand Up @@ -191,7 +193,7 @@ public function getFormatCode(): string
/**
* Set Format Code.
*/
public function setFormatCode(string $value = ''): self
public function setFormatCode(string $value = self::DEFAULT_FORMAT_CODE): self
{
$this->formatCode = $value;

Expand Down
3 changes: 2 additions & 1 deletion tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ public function testFont(): void
public function testFormatCode(): void
{
$object = new Axis();
self::assertEquals(Axis::DEFAULT_FORMAT_CODE, $object->getFormatCode());
self::assertInstanceOf(Axis::class, $object->setFormatCode());
self::assertEquals('', $object->getFormatCode());
self::assertEquals(Axis::DEFAULT_FORMAT_CODE, $object->getFormatCode());
self::assertInstanceOf(Axis::class, $object->setFormatCode('AAAA'));
self::assertEquals('AAAA', $object->getFormatCode());
}
Expand Down

0 comments on commit f6f0120

Please sign in to comment.