From bba779bfc3486256266d727ff8ffb0ebdf5c2eab Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Tue, 22 Feb 2011 23:01:44 +0000 Subject: [PATCH] Not sure why array_item() was being called with a $key of true, but it was resulting in a "method call on a non-object" error with gradient fills. git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@69199 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Reader/Excel2007.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/PHPExcel/Reader/Excel2007.php b/Classes/PHPExcel/Reader/Excel2007.php index 930ff42b..b4c80ac1 100644 --- a/Classes/PHPExcel/Reader/Excel2007.php +++ b/Classes/PHPExcel/Reader/Excel2007.php @@ -1573,8 +1573,8 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader } $docStyle->getFill()->setRotation(floatval($gradientFill["degree"])); $gradientFill->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main"); - $docStyle->getFill()->getStartColor()->setARGB(self::_readColor( self::array_item($gradientFill->xpath("sml:stop[@position=0]"),true)->color) ); - $docStyle->getFill()->getEndColor()->setARGB(self::_readColor( self::array_item($gradientFill->xpath("sml:stop[@position=1]"),true)->color) ); + $docStyle->getFill()->getStartColor()->setARGB(self::_readColor( self::array_item($gradientFill->xpath("sml:stop[@position=0]"))->color) ); + $docStyle->getFill()->getEndColor()->setARGB(self::_readColor( self::array_item($gradientFill->xpath("sml:stop[@position=1]"))->color) ); } elseif ($style->fill->patternFill) { $patternType = (string)$style->fill->patternFill["patternType"] != '' ? (string)$style->fill->patternFill["patternType"] : 'solid'; $docStyle->getFill()->setFillType($patternType);