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/Cell.php';
44 require_once PHPEXCEL_ROOT .
'PHPExcel/Cell/DataType.php';
47 require_once PHPEXCEL_ROOT .
'PHPExcel/RichText/ITextElement.php';
50 require_once PHPEXCEL_ROOT .
'PHPExcel/RichText/TextElement.php';
53 require_once PHPEXCEL_ROOT .
'PHPExcel/RichText/Run.php';
56 require_once PHPEXCEL_ROOT .
'PHPExcel/Style/Font.php';
90 $this->_richTextElements = array();
93 if (!is_null($pCell)) {
95 $this->_parent = $pCell;
98 if ($this->_parent->getValue() !=
"") {
100 $objRun->
setFont(clone $this->_parent->getParent()->getStyle($this->_parent->getCoordinate())->getFont());
118 $this->_richTextElements[] = $pText;
161 foreach ($this->_richTextElements as $text) {
162 $returnValue .= $text->getText();
197 if (is_array($pElements)) {
198 $this->_richTextElements = $pElements;
200 throw new Exception(
"Invalid PHPExcel_RichText_ITextElement[] array passed.");
222 $this->_parent = $value;
229 $sheet = $this->_parent->getParent();
230 $cellFont = $sheet->getStyle($this->_parent->getCoordinate())->getFont()->getSharedComponent();
234 if ($element->getFont()->getHashCode() == $sheet->getDefaultStyle()->getFont()->getHashCode()) {
235 if ($element->getFont()->getHashCode() != $cellFont->getHashCode()) {
236 $element->setFont(clone $cellFont);
250 foreach ($this->_richTextElements as $element) {
251 $hashElements .= $element->getHashCode();
288 $this->_hashIndex = $value;
295 $vars = get_object_vars($this);
296 foreach ($vars as
$key => $value) {
297 if (
$key ==
'_parent')
continue;
299 if (is_object($value)) {
300 $this->
$key = clone $value;
302 $this->
$key = $value;