Skip to content

Commit

Permalink
Freeze Panes takes wrong coordinates for XLSX
Browse files Browse the repository at this point in the history
Fixes #322
  • Loading branch information
PowerKiKi committed Jan 8, 2018
1 parent 653adf8 commit 25bc54f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Added

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

### Fixed

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

## [1.0.0] - 2017-12-25

Expand Down
4 changes: 2 additions & 2 deletions src/PhpSpreadsheet/Writer/Xls/Worksheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -1603,8 +1603,8 @@ private function writePanes()
return;
}

$y = isset($panes[0]) ? $panes[0] : null;
$x = isset($panes[1]) ? $panes[1] : null;
$x = isset($panes[0]) ? $panes[0] : null;
$y = isset($panes[1]) ? $panes[1] : null;
$rwTop = isset($panes[2]) ? $panes[2] : null;
$colLeft = isset($panes[3]) ? $panes[3] : null;
if (count($panes) > 4) { // if Active pane was received
Expand Down
4 changes: 2 additions & 2 deletions tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public function providerFormats()
*/
public function testFreezePane($format)
{
$cellSplit = 'B2';
$topLeftCell = 'E5';
$cellSplit = 'B4';
$topLeftCell = 'E7';

$spreadsheet = new Spreadsheet();
$spreadsheet->getActiveSheet()->freezePane($cellSplit, $topLeftCell);
Expand Down

0 comments on commit 25bc54f

Please sign in to comment.