From a39d71ec1681dcb60b74ca1806962e4bac80070f Mon Sep 17 00:00:00 2001 From: John Doe Date: Mon, 26 Dec 2016 12:20:24 +0900 Subject: [PATCH] Fix attaching drawing for xls FIX #53, #61 --- src/PhpSpreadsheet/Shared/Escher.php | 8 ++++++-- src/PhpSpreadsheet/Writer/Xls/Escher.php | 16 ++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/PhpSpreadsheet/Shared/Escher.php b/src/PhpSpreadsheet/Shared/Escher.php index 973a692c..1172fd7e 100644 --- a/src/PhpSpreadsheet/Shared/Escher.php +++ b/src/PhpSpreadsheet/Shared/Escher.php @@ -29,7 +29,7 @@ class Escher /** * Drawing Group Container. * - * @var \DggContainer + * @var Escher\DggContainer */ private $dggContainer; @@ -43,7 +43,7 @@ class Escher /** * Get Drawing Group Container. * - * @return Escher\DgContainer + * @return Escher\DggContainer */ public function getDggContainer() { @@ -54,6 +54,8 @@ class Escher * Set Drawing Group Container. * * @param Escher\DggContainer $dggContainer + * + * @return Escher\DggContainer */ public function setDggContainer($dggContainer) { @@ -74,6 +76,8 @@ class Escher * Set Drawing Container. * * @param Escher\DgContainer $dgContainer + * + * @return Escher\DgContainer */ public function setDgContainer($dgContainer) { diff --git a/src/PhpSpreadsheet/Writer/Xls/Escher.php b/src/PhpSpreadsheet/Writer/Xls/Escher.php index 3071eeb5..693d30ef 100644 --- a/src/PhpSpreadsheet/Writer/Xls/Escher.php +++ b/src/PhpSpreadsheet/Writer/Xls/Escher.php @@ -72,7 +72,7 @@ class Escher $this->data = ''; switch (get_class($this->object)) { - case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher': + case \PhpOffice\PhpSpreadsheet\Shared\Escher::class: if ($dggContainer = $this->object->getDggContainer()) { $writer = new self($dggContainer); $this->data = $writer->close(); @@ -83,7 +83,7 @@ class Escher $this->spTypes = $writer->getSpTypes(); } break; - case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer': + case \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer::class: // this is a container record // initialize @@ -136,7 +136,7 @@ class Escher $this->data = $header . $innerData; break; - case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer': + case \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer::class: // this is a container record // initialize @@ -163,7 +163,7 @@ class Escher $this->data = $header . $innerData; break; - case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE': + case \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::class: // this is a semi-container record // initialize @@ -212,7 +212,7 @@ class Escher $this->data .= $data; break; - case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE\\Blip': + case \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip::class: // this is an atom record // write the record @@ -271,7 +271,7 @@ class Escher break; } break; - case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer': + case \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer::class: // this is a container record // initialize @@ -323,7 +323,7 @@ class Escher $this->data = $header . $innerData; break; - case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer': + case \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer::class: // this is a container record // initialize @@ -362,7 +362,7 @@ class Escher $this->spOffsets = $spOffsets; $this->spTypes = $spTypes; break; - case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer\\SpContainer': + case \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer::class: // initialize $data = '';