Skip to content

Commit 25bc54f

Browse files
committed
Freeze Panes takes wrong coordinates for XLSX
Fixes #322
1 parent 653adf8 commit 25bc54f

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Added
1111

12-
- Support cell comments in HTML writer and reader- [#308](https://github.com/PHPOffice/PhpSpreadsheet/issues/308)
12+
- Support cell comments in HTML writer and reader - [#308](https://github.com/PHPOffice/PhpSpreadsheet/issues/308)
1313
- Option to stop at a conditional styling, if it matches (only XLSX format) - [#292](https://github.com/PHPOffice/PhpSpreadsheet/pull/292)
1414

1515
### Fixed
1616

1717
- Better auto-detection of CSV separators - [#305](https://github.com/PHPOffice/PhpSpreadsheet/issues/305)
1818
- Support for shape style ending with `;` - [#304](https://github.com/PHPOffice/PhpSpreadsheet/issues/304)
19+
- Freeze Panes takes wrong coordinates for XLSX - [#322](https://github.com/PHPOffice/PhpSpreadsheet/issues/322)
1920

2021
## [1.0.0] - 2017-12-25
2122

src/PhpSpreadsheet/Writer/Xls/Worksheet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,8 +1603,8 @@ private function writePanes()
16031603
return;
16041604
}
16051605

1606-
$y = isset($panes[0]) ? $panes[0] : null;
1607-
$x = isset($panes[1]) ? $panes[1] : null;
1606+
$x = isset($panes[0]) ? $panes[0] : null;
1607+
$y = isset($panes[1]) ? $panes[1] : null;
16081608
$rwTop = isset($panes[2]) ? $panes[2] : null;
16091609
$colLeft = isset($panes[3]) ? $panes[3] : null;
16101610
if (count($panes) > 4) { // if Active pane was received

tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public function providerFormats()
2121
*/
2222
public function testFreezePane($format)
2323
{
24-
$cellSplit = 'B2';
25-
$topLeftCell = 'E5';
24+
$cellSplit = 'B4';
25+
$topLeftCell = 'E7';
2626

2727
$spreadsheet = new Spreadsheet();
2828
$spreadsheet->getActiveSheet()->freezePane($cellSplit, $topLeftCell);

0 commit comments

Comments
 (0)