Skip to content

Commit

Permalink
Prevent notice during accessing "cached magnification factor" offset
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-Simon Winkelmann committed Sep 21, 2020
1 parent 9683e5b commit c0f89b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ and this project adheres to [Semantic Versioning](https://semver.org).

### Fixed

- PrintArea causes exception [#1544](https://github.com/phpoffice/phpspreadsheet/pull/1544)
- PrintArea causes exception [#1544](https://github.com/phpoffice/phpspreadsheet/pull/1544)
- Fix for notice during accessing "cached magnification factor" offset [#1354](https://github.com/PHPOffice/PhpSpreadsheet/pull/1354)

## 1.14.1 - 2020-07-19

Expand Down
15 changes: 13 additions & 2 deletions src/PhpSpreadsheet/Reader/Xls.php
Original file line number Diff line number Diff line change
Expand Up @@ -4377,11 +4377,22 @@ private function readWindow2(): void
// offset: 10; size: 2; cached magnification factor in page break preview (in percent); 0 = Default (60%)
// offset: 12; size: 2; cached magnification factor in normal view (in percent); 0 = Default (100%)
// offset: 14; size: 4; not used
$zoomscaleInPageBreakPreview = self::getUInt2d($recordData, 10);
if (!isset($recordData[10])) {
$zoomscaleInPageBreakPreview = 0;
} else {
$zoomscaleInPageBreakPreview = self::getUInt2d($recordData, 10);
}

if ($zoomscaleInPageBreakPreview === 0) {
$zoomscaleInPageBreakPreview = 60;
}
$zoomscaleInNormalView = self::getUInt2d($recordData, 12);

if (!isset($recordData[12])) {
$zoomscaleInNormalView = 0;
} else {
$zoomscaleInNormalView = self::getUInt2d($recordData, 12);
}

if ($zoomscaleInNormalView === 0) {
$zoomscaleInNormalView = 100;
}
Expand Down

0 comments on commit c0f89b9

Please sign in to comment.