Ejemplo n.º 1
0
    /**
     * Set parent
     *
     * @param PHPExcel_Cell	$value
     */
    public function setParent(PHPExcel_Cell $value) {
    	// Set parent
    	$this->_parent = $value;

    	// Set parent value
    	$this->_parent->setValue($this);
    }
Ejemplo n.º 2
0
 /**
  * Set parent
  *
  * @param PHPExcel_Cell	$value
  */
 public function setParent(PHPExcel_Cell $value)
 {
     // Set parent
     $this->_parent = $value;
     // Set parent value
     $this->_parent->setValue($this);
     // Verify style information
     $sheet = $this->_parent->getParent();
     $cellFont = $sheet->getStyle($this->_parent->getCoordinate())->getFont();
     foreach ($this->getRichTextElements() as $element) {
         if (!$element instanceof PHPExcel_RichText_Run) {
             continue;
         }
         if ($element->getFont()->getHashCode() == $sheet->getDefaultStyle()->getFont()->getHashCode()) {
             if ($element->getFont()->getHashCode() != $cellFont->getHashCode()) {
                 $element->setFont(clone $cellFont);
             }
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * @param null|int $index
  * @param null|mixed $value
  * @param null|array $properties
  *
  * @throws \PHPExcel_Exception
  */
 public function start($index = null, $value = null, array $properties = null)
 {
     if ($this->sheetWrapper->getObject() === null) {
         throw new \LogicException();
     }
     if ($index !== null && !is_int($index)) {
         throw new \InvalidArgumentException();
     }
     if ($index === null) {
         $this->sheetWrapper->increaseColumn();
     } else {
         $this->sheetWrapper->setColumn($index);
     }
     $this->object = $this->sheetWrapper->getObject()->getCellByColumnAndRow($this->sheetWrapper->getColumn(), $this->sheetWrapper->getRow());
     if ($value !== null) {
         $this->object->setValue($value);
     }
     if ($properties !== null) {
         $this->setProperties($properties, $this->mappings);
     }
     $this->attributes['value'] = $value;
     $this->attributes['properties'] = $properties ?: [];
 }