Merge pull request #94 from Slamdunk/hotfix/dereferencing

Use appropriate dereferencing
This commit is contained in:
Mark Baker 2012-11-25 03:15:03 -08:00
commit ef492043cb
1 changed files with 6 additions and 6 deletions

View File

@ -826,20 +826,20 @@ class PHPExcel_Worksheet_AutoFilter
if (is_object($value)) { if (is_object($value)) {
if ($key == '_workSheet') { if ($key == '_workSheet') {
// Detach from worksheet // Detach from worksheet
$this->$key = NULL; $this->{$key} = NULL;
} else { } else {
$this->$key = clone $value; $this->{$key} = clone $value;
} }
} elseif ((is_array($value)) && ($key == '_columns')) { } elseif ((is_array($value)) && ($key == '_columns')) {
// The columns array of PHPExcel_Worksheet_AutoFilter objects // The columns array of PHPExcel_Worksheet_AutoFilter objects
$this->$key = array(); $this->{$key} = array();
foreach ($value as $k => $v) { foreach ($value as $k => $v) {
$this->$key[$k] = clone $v; $this->{$key}[$k] = clone $v;
// attach the new cloned Column to this new cloned Autofilter object // attach the new cloned Column to this new cloned Autofilter object
$this->$key[$k]->setParent($this); $this->{$key}[$k]->setParent($this);
} }
} else { } else {
$this->$key = $value; $this->{$key} = $value;
} }
} }
} }