From b0c5c19ed381d57914a1722f8f467877f52a8b24 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Thu, 2 Sep 2010 21:41:41 +0000 Subject: [PATCH] AddedFeature: Work item 8769 - Implement Gnumeric File Format Added ReadFilter and Merged Cell handling to Gnumeric Reader git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@60298 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Reader/Gnumeric.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Classes/PHPExcel/Reader/Gnumeric.php b/Classes/PHPExcel/Reader/Gnumeric.php index e0bb94a7..99afe8a6 100644 --- a/Classes/PHPExcel/Reader/Gnumeric.php +++ b/Classes/PHPExcel/Reader/Gnumeric.php @@ -356,6 +356,14 @@ class PHPExcel_Reader_Gnumeric implements PHPExcel_Reader_IReader $cellAttributes = $cell->attributes(); $row = (string) $cellAttributes->Row + 1; $column = PHPExcel_Cell::stringFromColumnIndex($cellAttributes->Col); + + // Read cell? + if (!is_null($this->getReadFilter())) { + if (!$this->getReadFilter()->readCell($column, $row, $worksheetName)) { + continue; + } + } + $ValueType = $cellAttributes->ValueType; $ExprID = (string) $cellAttributes->ExprID; // echo 'Cell ',$column,$row,'
'; @@ -398,6 +406,11 @@ class PHPExcel_Reader_Gnumeric implements PHPExcel_Reader_IReader $objPHPExcel->getActiveSheet()->getCell($column.$row)->setValueExplicit($cell,$type); } + if (isset($sheet->MergedRegions)) { + foreach($sheet->MergedRegions->Merge as $mergeCells) { + $objPHPExcel->getActiveSheet()->mergeCells($mergeCells); + } + } $worksheetID++; }