You are here

public function PHPExcel_RichText::__construct in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/RichText.php \PHPExcel_RichText::__construct()

Create a new PHPExcel_RichText instance

Parameters

PHPExcel_Cell $pCell:

Throws

PHPExcel_Exception

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/RichText.php, line 51

Class

PHPExcel_RichText
PHPExcel_RichText

Code

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);
  }
}