From 0b1d8c58c4d46cc4f0da4d7f5d582bc58e7cde35 Mon Sep 17 00:00:00 2001 From: WFarmerEthisphere Date: Fri, 6 Oct 2023 09:35:00 -0700 Subject: [PATCH] Fixed broken powerpoint presentations due to MS Office update 2309 --- docs/changes/1.1.0.md | 5 +++-- src/PhpPresentation/Shape/Chart/Axis.php | 4 +++- tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/changes/1.1.0.md b/docs/changes/1.1.0.md index 26d0655f5..aed989f2b 100644 --- a/docs/changes/1.1.0.md +++ b/docs/changes/1.1.0.md @@ -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) \ No newline at end of file +- 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) \ No newline at end of file diff --git a/src/PhpPresentation/Shape/Chart/Axis.php b/src/PhpPresentation/Shape/Chart/Axis.php index f8588e903..3cf1ae699 100644 --- a/src/PhpPresentation/Shape/Chart/Axis.php +++ b/src/PhpPresentation/Shape/Chart/Axis.php @@ -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. * @@ -58,7 +60,7 @@ class Axis implements ComparableInterface * * @var string */ - private $formatCode = ''; + private $formatCode = self::DEFAULT_FORMAT_CODE; /** * Font. diff --git a/tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php b/tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php index 7cf9ee391..2a4f4567c 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php @@ -93,7 +93,7 @@ public function testFormatCode(): void { $object = new Axis(); 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()); }