From d13493ecbedf57253448438311c1d04a3ebdb65e Mon Sep 17 00:00:00 2001 From: Benjamin Yau Date: Mon, 21 Jan 2019 22:05:52 +0800 Subject: [PATCH] Revert "Fix wrong calculation of highest column" This reverts commit ef39af1cb6bac8f3101aa52a6336d736910d387b. --- src/PhpSpreadsheet/Collection/Cells.php | 2 +- src/PhpSpreadsheet/Reader/Xlsx.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PhpSpreadsheet/Collection/Cells.php b/src/PhpSpreadsheet/Collection/Cells.php index 465a0698c6..80a4322098 100644 --- a/src/PhpSpreadsheet/Collection/Cells.php +++ b/src/PhpSpreadsheet/Collection/Cells.php @@ -259,7 +259,7 @@ public function getHighestColumn($row = null) $columnList[] = Coordinate::columnIndexFromString($c); } - return Coordinate::stringFromColumnIndex(max($columnList)); + return Coordinate::stringFromColumnIndex(max($columnList) + 1); } /** diff --git a/src/PhpSpreadsheet/Reader/Xlsx.php b/src/PhpSpreadsheet/Reader/Xlsx.php index 92c837f5b7..335f5d7e99 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/src/PhpSpreadsheet/Reader/Xlsx.php @@ -2525,10 +2525,6 @@ private function readColumnsAndRowsAttributes(SimpleXMLElement $xmlSheet, Worksh if (isset($xmlSheet->cols) && !$this->readDataOnly) { foreach ($xmlSheet->cols->col as $col) { for ($i = (int) ($col['min']); $i <= (int) ($col['max']); ++$i) { - if ((int) ($col['max']) == 16384) { - break; - } - if ($col['style'] && !$this->readDataOnly) { $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['xfIndex'] = (int) $col['style']; } @@ -2542,6 +2538,10 @@ private function readColumnsAndRowsAttributes(SimpleXMLElement $xmlSheet, Worksh $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['outlineLevel'] = (int) $col['outlineLevel']; } $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['width'] = (float) $col['width']; + + if ((int) ($col['max']) == 16384) { + break; + } } } }