/**
  * Create a new PHPExcel_RichText instance
  *
  * @param 	PHPExcel_Cell	$pParent
  * @throws	PHPExcel_Exception
  */
 public function __construct(PHPExcel_Cell $pCell = null)
 {
     // Initialise variables
     $this->_richTextElements = array();
     // Rich-Text string attached to cell?
     if ($pCell !== NULL) {
         // Add cell text and style
         if ($pCell->getValue() != "") {
             $objRun = new PHPExcel_RichText_Run($pCell->getValue());
             $objRun->setFont(clone $pCell->getParent()->getStyle($pCell->getCoordinate())->getFont());
             $this->addText($objRun);
         }
         // Set parent value
         $pCell->setValueExplicit($this, PHPExcel_Cell_DataType::TYPE_STRING);
     }
 }
Exemple #2
0
 /**
  * Create a new PHPExcel_RichText instance
  *
  * @param 	PHPExcel_Cell	$pParent
  * @throws	Exception
  */
 public function __construct(PHPExcel_Cell $pCell = null)
 {
     // Initialise variables
     $this->_richTextElements = array();
     // Set parent?
     if (!is_null($pCell)) {
         // Set parent cell
         $this->_parent = $pCell;
         // Add cell text and style
         if ($this->_parent->getValue() != "") {
             $objRun = new PHPExcel_RichText_Run($this->_parent->getValue());
             $objRun->setFont(clone $this->_parent->getParent()->getStyle($this->_parent->getCoordinate())->getFont());
             $this->addText($objRun);
         }
         // Set parent value
         $this->_parent->setValue($this);
     }
 }
Exemple #3
0
 private function applyCellCommentTextOptions(\PHPExcel_RichText_Run $commentText, array $options)
 {
     $makeBold = array_key_exists('bold', $options) && true === $options['bold'];
     if ($makeBold) {
         $commentText->getFont()->setBold($makeBold);
     }
 }