30 if (!defined(
'PHPEXCEL_ROOT')) {
34 define(
'PHPEXCEL_ROOT', dirname(__FILE__) .
'/../../');
38 require_once PHPEXCEL_ROOT .
'PHPExcel/IComparable.php';
41 require_once PHPEXCEL_ROOT .
'PHPExcel/Worksheet.php';
44 require_once PHPEXCEL_ROOT .
'PHPExcel/Worksheet/Drawing/Shadow.php';
153 $this->_description =
'';
154 $this->_worksheet = null;
155 $this->_coordinates =
'A1';
160 $this->_resizeProportional =
true;
161 $this->_rotation = 0;
165 self::$_imageCounter++;
194 $this->_name = $pValue;
214 $this->_description = $pValue;
236 if (is_null($this->_worksheet)) {
238 $this->_worksheet = $pValue;
239 $this->_worksheet->getCell($this->_coordinates);
240 $this->_worksheet->getDrawingCollection()->append($this);
244 $iterator = $this->_worksheet->getDrawingCollection()->getIterator();
246 while ($iterator->valid()) {
247 if ($iterator->current()->getHashCode() == $this->
getHashCode()) {
248 $this->_worksheet->getDrawingCollection()->offsetUnset( $iterator->key() );
249 $this->_worksheet = null;
257 throw new Exception(
"A PHPExcel_Worksheet has already been assigned. Drawings can only exist on one PHPExcel_Worksheet.");
279 $this->_coordinates = $pValue;
299 $this->_offsetX = $pValue;
319 $this->_offsetY = $pValue;
340 if ($this->_resizeProportional && $pValue != 0) {
342 $this->_height = round($ratio * $pValue);
346 $this->_width = $pValue;
368 if ($this->_resizeProportional && $pValue != 0) {
370 $this->_width = round($ratio * $pValue);
374 $this->_height = $pValue;
395 if ($this->_resizeProportional && !($width == 0 || $height == 0)) {
396 if (($xratio * $this->_height) < $height) {
397 $this->_height = ceil($xratio * $this->_height);
398 $this->_width = $width;
400 $this->_width = ceil($yratio * $this->_width);
401 $this->_height = $height;
423 $this->_resizeProportional = $pValue;
443 $this->_rotation = $pValue;
464 $this->_shadow = $pValue;
476 . $this->_description
477 . $this->_worksheet->getHashCode()
478 . $this->_coordinates
484 . $this->_shadow->getHashCode()
517 $this->_hashIndex = $value;
524 $vars = get_object_vars($this);
525 foreach ($vars as
$key => $value) {
526 if (is_object($value)) {
527 $this->
$key = clone $value;
529 $this->
$key = $value;