From 4fbeddb5664d9ff344497ba77c6691dc179b16fe Mon Sep 17 00:00:00 2001 From: M_Viper Date: Sun, 10 Mar 2024 15:32:06 +0000 Subject: [PATCH] Dateien nach "includes/PHPExcel/Classes/PHPExcel/RichText" hochladen --- .../PHPExcel/RichText/ITextElement.php | 64 +++++++++++ .../Classes/PHPExcel/RichText/Run.php | 102 +++++++++++++++++ .../Classes/PHPExcel/RichText/TextElement.php | 108 ++++++++++++++++++ 3 files changed, 274 insertions(+) create mode 100644 includes/PHPExcel/Classes/PHPExcel/RichText/ITextElement.php create mode 100644 includes/PHPExcel/Classes/PHPExcel/RichText/Run.php create mode 100644 includes/PHPExcel/Classes/PHPExcel/RichText/TextElement.php diff --git a/includes/PHPExcel/Classes/PHPExcel/RichText/ITextElement.php b/includes/PHPExcel/Classes/PHPExcel/RichText/ITextElement.php new file mode 100644 index 0000000..9f1c624 --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/RichText/ITextElement.php @@ -0,0 +1,64 @@ +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; + } + } + } +} diff --git a/includes/PHPExcel/Classes/PHPExcel/RichText/TextElement.php b/includes/PHPExcel/Classes/PHPExcel/RichText/TextElement.php new file mode 100644 index 0000000..ec7c264 --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/RichText/TextElement.php @@ -0,0 +1,108 @@ +_text = $pText; + } + + /** + * Get text + * + * @return string Text + */ + public function getText() { + return $this->_text; + } + + /** + * Set text + * + * @param $pText string Text + * @return PHPExcel_RichText_ITextElement + */ + public function setText($pText = '') { + $this->_text = $pText; + return $this; + } + + /** + * Get font + * + * @return PHPExcel_Style_Font + */ + public function getFont() { + return null; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() { + return md5( + $this->_text + . __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; + } + } + } +}