diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a60764c59..d67235fc29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,16 +9,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added -- HTML writer creates a generator meta tag - [#312](https://github.com/PHPOffice/PhpSpreadsheet/issues/312) +- HTML writer creates a generator meta tag - [#312](https://github.com/PHPOffice/PhpSpreadsheet/issues/312) - Support invalid zoom value in XLSX format - [#350](https://github.com/PHPOffice/PhpSpreadsheet/pull/350) - Support for `_xlfn.` prefixed functions and `ISFORMULA`, `MODE.SNGL`, `STDEV.S`, `STDEV.P` - [#390](https://github.com/PHPOffice/PhpSpreadsheet/pull/390) ### Fixed -- Avoid potentially unsupported PSR-16 cache keys - [#354](https://github.com/PHPOffice/PhpSpreadsheet/issues/354) -- Check for MIME type to know if CSV reader can read a file - [#167](https://github.com/PHPOffice/PhpSpreadsheet/issues/167) -- Use proper € symbol for currency format - [#379](https://github.com/PHPOffice/PhpSpreadsheet/pull/379) -- Read printing area correctly when skipping some sheets - [#371](https://github.com/PHPOffice/PhpSpreadsheet/issues/371) +- Select correct cell when calling freezePane - [#389](https://github.com/PHPOffice/PhpSpreadsheet/issues/389) +- Avoid potentially unsupported PSR-16 cache keys - [#354](https://github.com/PHPOffice/PhpSpreadsheet/issues/354) +- Check for MIME type to know if CSV reader can read a file - [#167](https://github.com/PHPOffice/PhpSpreadsheet/issues/167) +- Use proper € symbol for currency format - [#379](https://github.com/PHPOffice/PhpSpreadsheet/pull/379) +- Read printing area correctly when skipping some sheets - [#371](https://github.com/PHPOffice/PhpSpreadsheet/issues/371) ## [1.1.0] - 2018-01-28 diff --git a/src/PhpSpreadsheet/Worksheet/Worksheet.php b/src/PhpSpreadsheet/Worksheet/Worksheet.php index c7f08fee82..156a360ca2 100644 --- a/src/PhpSpreadsheet/Worksheet/Worksheet.php +++ b/src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -1971,7 +1971,7 @@ public function getFreezePane() * * - A2 will freeze the rows above cell A2 (i.e row 1) * - B1 will freeze the columns to the left of cell B1 (i.e column A) - * - B2 will freeze the rows above and to the left of cell A2 (i.e row 1 and column A) + * - B2 will freeze the rows above and to the left of cell B2 (i.e row 1 and column A) * * @param null|string $cell Position of the split * @param null|string $topLeftCell default position of the right bottom pane @@ -1988,7 +1988,7 @@ public function freezePane($cell, $topLeftCell = null) if ($cell !== null && $topLeftCell === null) { $coordinate = Coordinate::coordinateFromString($cell); - $topLeftCell = $coordinate[0] . ($coordinate[1] + 1); + $topLeftCell = $coordinate[0] . $coordinate[1]; } $this->freezePane = $cell; diff --git a/tests/PhpSpreadsheetTests/Worksheet/WorksheetTest.php b/tests/PhpSpreadsheetTests/Worksheet/WorksheetTest.php index d92a3d08ec..5dfa825905 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/WorksheetTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/WorksheetTest.php @@ -123,4 +123,11 @@ public function testSetCodeNameDuplicate() $sheet->setCodeName('Test Code Name', false); self::assertSame('Test Code Name', $sheet->getCodeName()); } + + public function testFreezePaneSelectedCell() + { + $worksheet = new Worksheet(); + $worksheet->freezePane('B2'); + self::assertSame('B2', $worksheet->getTopLeftCell()); + } }