Skip to content

Commit f6f0120

Browse files
authored
Merge pull request #770 from Progi1984/pr761
Fixed broken powerpoint presentations due to MS Office update 2309
2 parents 273e776 + c858a7b commit f6f0120

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

docs/changes/1.1.0.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
- Support for Hyperlink Text Color - [@MartynasJanu](https://github.com/MartynasJanu) & [@Progi1984](https://github.com/Progi1984) in [#682](https://github.com/PHPOffice/PHPPresentation/pull/682)
1010
- PowerPoint2007 Reader
1111
- PowerPoint2007 Writer
12-
- Added support for PHP 8.2 & 8.3 - [@Progi1984](https://github.com/Progi1984) in [#766](https://github.com/PHPOffice/PHPPresentation/pull/766)
12+
- Added support for PHP 8.2 & 8.3 - [@Progi1984](https://github.com/Progi1984) in [#769](https://github.com/PHPOffice/PHPPresentation/pull/769)
1313

1414
## Bugfixes
1515

16-
- Fixed CI - [@Progi1984](https://github.com/Progi1984) in [#766](https://github.com/PHPOffice/PHPPresentation/pull/766)
16+
- Fixed CI - [@Progi1984](https://github.com/Progi1984) in [#766](https://github.com/PHPOffice/PHPPresentation/pull/766)
17+
- Fixed broken PPT Presentations due to MS Office update 2309 - [@WFarmerEthisphere](https://github.com/WFarmerEthisphere) in [#770](https://github.com/PHPOffice/PHPPresentation/pull/770)

src/PhpPresentation/Shape/Chart/Axis.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class Axis implements ComparableInterface
4141
public const CROSSES_MIN = 'min';
4242
public const CROSSES_MAX = 'max';
4343

44+
public const DEFAULT_FORMAT_CODE = 'general';
45+
4446
/**
4547
* Title.
4648
*
@@ -58,7 +60,7 @@ class Axis implements ComparableInterface
5860
*
5961
* @var string
6062
*/
61-
private $formatCode = '';
63+
private $formatCode = self::DEFAULT_FORMAT_CODE;
6264

6365
/**
6466
* Font.
@@ -191,7 +193,7 @@ public function getFormatCode(): string
191193
/**
192194
* Set Format Code.
193195
*/
194-
public function setFormatCode(string $value = ''): self
196+
public function setFormatCode(string $value = self::DEFAULT_FORMAT_CODE): self
195197
{
196198
$this->formatCode = $value;
197199

tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ public function testFont(): void
9292
public function testFormatCode(): void
9393
{
9494
$object = new Axis();
95+
self::assertEquals(Axis::DEFAULT_FORMAT_CODE, $object->getFormatCode());
9596
self::assertInstanceOf(Axis::class, $object->setFormatCode());
96-
self::assertEquals('', $object->getFormatCode());
97+
self::assertEquals(Axis::DEFAULT_FORMAT_CODE, $object->getFormatCode());
9798
self::assertInstanceOf(Axis::class, $object->setFormatCode('AAAA'));
9899
self::assertEquals('AAAA', $object->getFormatCode());
99100
}

0 commit comments

Comments
 (0)