diff --git a/Classes/PHPExcel/Worksheet.php b/Classes/PHPExcel/Worksheet.php index b1397502..4e3d2b76 100644 --- a/Classes/PHPExcel/Worksheet.php +++ b/Classes/PHPExcel/Worksheet.php @@ -2105,6 +2105,11 @@ class PHPExcel_Worksheet implements PHPExcel_IComparable */ public function fromArray($source = null, $nullValue = null, $startCell = 'A1', $strictNullComparison = false) { if (is_array($source)) { + // Convert a 1-D array to 2-D (for ease of looping) + if (!is_array(end($source))) { + $source = array($source); + } + // start coordinate list ($startColumn, $startRow) = PHPExcel_Cell::coordinateFromString($startCell); diff --git a/changelog.txt b/changelog.txt index fb3cfc8e..e5eae9ec 100644 --- a/changelog.txt +++ b/changelog.txt @@ -45,6 +45,7 @@ Fixed in SVN: - Bugfix: (MBaker) Minor patchfix for Excel2003XML Reader when XML is defined with a charset attribute - Bugfix: (MBaker) Work item 15089 - PHPExcel_Worksheet->toArray() index problem - Bugfix: (MBaker) Work item 15094 - Merge cells 'un-merge' when using an existing spreadsheet +- Bugfix: (MBaker) Work item 15129 - Worksheet fromArray() only working with 2-D arrays - General: (MBaker) Improved performance (speed), for building the Shared Strings table in the Excel2007 Writer.