From 41a1aa9ede042b564521ca5b03e2e34c1115674a Mon Sep 17 00:00:00 2001 From: Davis Devasia Date: Sat, 9 Sep 2017 00:13:12 +0530 Subject: [PATCH] Uncommented the increment of $imageCounter (#205) The static variable $imageCounter previously had a constant value of 0 throughout the program as it was never being modified, because it was commented out by mistake. Now it increments every time a new drawing is being instantiated. This also fixed a problem when multiple images of same name in the same worksheet are incorrectly displayed. Fixes #204 Closes #205 --- src/PhpSpreadsheet/Worksheet/BaseDrawing.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php index 9f9ad163..c9a2921d 100644 --- a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php @@ -139,7 +139,8 @@ class BaseDrawing implements IComparable $this->rotation = 0; $this->shadow = new Drawing\Shadow(); - // Set image index++self::$imageCounter; + // Set image index + ++self::$imageCounter; $this->imageIndex = self::$imageCounter; }