From 6832332703776978bc82696c96c31f2587565beb Mon Sep 17 00:00:00 2001 From: ankitm123 Date: Wed, 1 Mar 2017 22:37:32 -0500 Subject: [PATCH 1/4] Testing some changes --- src/PhpSpreadsheet/Worksheet.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/PhpSpreadsheet/Worksheet.php b/src/PhpSpreadsheet/Worksheet.php index 652196644c..a99f1f8478 100644 --- a/src/PhpSpreadsheet/Worksheet.php +++ b/src/PhpSpreadsheet/Worksheet.php @@ -2974,9 +2974,6 @@ public function __clone() $newCollection = clone $this->cellCollection; $newCollection->copyCellCollection($this); $this->cellCollection = $newCollection; - } elseif ($key == 'drawingCollection') { - $newCollection = clone $this->drawingCollection; - $this->drawingCollection = $newCollection; } elseif (($key == 'autoFilter') && ($this->autoFilter instanceof Worksheet\AutoFilter)) { $newAutoFilter = clone $this->autoFilter; $this->autoFilter = $newAutoFilter; From a5e6d02c727676c0f3e4a537e400d4fe3af031ff Mon Sep 17 00:00:00 2001 From: ankitm123 Date: Wed, 1 Mar 2017 22:41:30 -0500 Subject: [PATCH 2/4] Testing some changes --- test | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test diff --git a/test b/test new file mode 100644 index 0000000000..e69de29bb2 From e77b2c08e505e23c86bbc7eda8072b2019015c82 Mon Sep 17 00:00:00 2001 From: ankitm123 Date: Thu, 2 Mar 2017 11:41:01 -0500 Subject: [PATCH 3/4] Memory Drawing bug fix --- .gitignore | 2 ++ src/PhpSpreadsheet/Worksheet.php | 10 ++++++++++ src/PhpSpreadsheet/Worksheet/MemoryDrawing.php | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 011328ed9a..cd1a0ead6e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ /tests/codeCoverage /analysis /vendor/ +/square/ +/public/ /phpunit.xml /.php_cs.cache diff --git a/src/PhpSpreadsheet/Worksheet.php b/src/PhpSpreadsheet/Worksheet.php index a99f1f8478..4111bddbcb 100644 --- a/src/PhpSpreadsheet/Worksheet.php +++ b/src/PhpSpreadsheet/Worksheet.php @@ -2,6 +2,8 @@ namespace PhpOffice\PhpSpreadsheet; +use ArrayObject; + /** * Copyright (c) 2006 - 2016 PhpSpreadsheet. * @@ -2974,6 +2976,14 @@ public function __clone() $newCollection = clone $this->cellCollection; $newCollection->copyCellCollection($this); $this->cellCollection = $newCollection; + } elseif ($key == 'drawingCollection') { + $newCollection = new ArrayObject(); + foreach ($this->drawingCollection as $id => $item) { + if (is_object($item)) { + $newCollection[$id] = clone $this->drawingCollection[$id]; + } + } + $this->drawingCollection = $newCollection; } elseif (($key == 'autoFilter') && ($this->autoFilter instanceof Worksheet\AutoFilter)) { $newAutoFilter = clone $this->autoFilter; $this->autoFilter = $newAutoFilter; diff --git a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php index 130f012965..4011aa5963 100644 --- a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php @@ -197,7 +197,7 @@ public function __clone() $vars = get_object_vars($this); foreach ($vars as $key => $value) { if (is_object($value)) { - $this->$key = clone $value; + $this->$key = unserialize(serialize($value)); } else { $this->$key = $value; } From ce377d7a07af90dd1551de0927373b060f524588 Mon Sep 17 00:00:00 2001 From: ankitm123 Date: Thu, 2 Mar 2017 12:09:27 -0500 Subject: [PATCH 4/4] Memory Drawing bug fix --- .gitignore | 2 -- test | 0 2 files changed, 2 deletions(-) delete mode 100644 test diff --git a/.gitignore b/.gitignore index cd1a0ead6e..011328ed9a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ /tests/codeCoverage /analysis /vendor/ -/square/ -/public/ /phpunit.xml /.php_cs.cache diff --git a/test b/test deleted file mode 100644 index e69de29bb2..0000000000