| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- class PHPExcel_RichText_Run extends PHPExcel_RichText_TextElement implements PHPExcel_RichText_ITextElement
- {
- /**
- * Font
- *
- * @var PHPExcel_Style_Font
- */
- private $font;
- /**
- * Create a new PHPExcel_RichText_Run instance
- *
- * @param string $pText Text
- */
- public function __construct($pText = '')
- {
- // Initialise variables
- $this->setText($pText);
- $this->font = new PHPExcel_Style_Font();
- }
- /**
- * Get font
- *
- * @return PHPExcel_Style_Font
- */
- public function getFont()
- {
- return $this->font;
- }
- /**
- * Set font
- *
- * @param PHPExcel_Style_Font $pFont Font
- * @throws PHPExcel_Exception
- * @return PHPExcel_RichText_ITextElement
- */
- public function setFont(PHPExcel_Style_Font $pFont = null)
- {
- $this->font = $pFont;
- return $this;
- }
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- return md5(
- $this->getText() .
- $this->font->getHashCode() .
- __CLASS__
- );
- }
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
- }
|