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 broken powerpoint presentations due to MS Office update 2309 #770

Merged
merged 1 commit into from
Dec 4, 2023
Merged
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
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
Loading