From 9bec4af0019fc0aa0e7de928444671b92ccb1e9e Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Wed, 18 Jan 2012 17:55:51 +0000 Subject: [PATCH] Fix to inappropriate replacement of count() with empty().... there may be others I've not spotted yet. git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@85438 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Writer/Excel5.php | 6 +++--- Classes/PHPExcel/Writer/Excel5/Workbook.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/PHPExcel/Writer/Excel5.php b/Classes/PHPExcel/Writer/Excel5.php index 20b094a..1f1e650 100644 --- a/Classes/PHPExcel/Writer/Excel5.php +++ b/Classes/PHPExcel/Writer/Excel5.php @@ -223,7 +223,7 @@ class PHPExcel_Writer_Excel5 implements PHPExcel_Writer_IWriter $escher = null; // check if there are any shapes for this sheet - if (empty($sheet->getDrawingCollection())) { + if (count($sheet->getDrawingCollection()) == 0) { continue; } @@ -319,7 +319,7 @@ class PHPExcel_Writer_Excel5 implements PHPExcel_Writer_IWriter // any drawings in this workbook? $found = false; foreach ($this->_phpExcel->getAllSheets() as $sheet) { - if (!empty($sheet->getDrawingCollection())) { + if (count($sheet->getDrawingCollection()) > 0) { $found = true; break; } @@ -348,7 +348,7 @@ class PHPExcel_Writer_Excel5 implements PHPExcel_Writer_IWriter foreach ($this->_phpExcel->getAllsheets() as $sheet) { $sheetCountShapes = 0; // count number of shapes (minus group shape), in sheet - if (!empty($sheet->getDrawingCollection())) { + if (count($sheet->getDrawingCollection()) > 0) { ++$countDrawings; foreach ($sheet->getDrawingCollection() as $drawing) { diff --git a/Classes/PHPExcel/Writer/Excel5/Workbook.php b/Classes/PHPExcel/Writer/Excel5/Workbook.php index 304ed23..f8599d5 100644 --- a/Classes/PHPExcel/Writer/Excel5/Workbook.php +++ b/Classes/PHPExcel/Writer/Excel5/Workbook.php @@ -643,7 +643,7 @@ class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter $chunk = ''; // Named ranges - if (!empty($this->_phpExcel->getNamedRanges())) { + if (count($this->_phpExcel->getNamedRanges()) > 0) { // Loop named ranges $namedRanges = $this->_phpExcel->getNamedRanges(); foreach ($namedRanges as $namedRange) {