Updated gui for user facility settings (#1327)
[openemr.git] / vendor / phpoffice / phpexcel / Classes / PHPExcel / RichText / Run.php
blob4a8c592e34e936663b565334ab4d38bfe420fd98
1 <?php
2 /**
3 * PHPExcel
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 * @category PHPExcel
20 * @package PHPExcel_RichText
21 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
22 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
23 * @version ##VERSION##, ##DATE##
27 /**
28 * PHPExcel_RichText_Run
30 * @category PHPExcel
31 * @package PHPExcel_RichText
32 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
34 class PHPExcel_RichText_Run extends PHPExcel_RichText_TextElement implements PHPExcel_RichText_ITextElement
36 /**
37 * Font
39 * @var PHPExcel_Style_Font
41 private $_font;
43 /**
44 * Create a new PHPExcel_RichText_Run instance
46 * @param string $pText Text
48 public function __construct($pText = '')
50 // Initialise variables
51 $this->setText($pText);
52 $this->_font = new PHPExcel_Style_Font();
55 /**
56 * Get font
58 * @return PHPExcel_Style_Font
60 public function getFont() {
61 return $this->_font;
64 /**
65 * Set font
67 * @param PHPExcel_Style_Font $pFont Font
68 * @throws PHPExcel_Exception
69 * @return PHPExcel_RichText_ITextElement
71 public function setFont(PHPExcel_Style_Font $pFont = null) {
72 $this->_font = $pFont;
73 return $this;
76 /**
77 * Get hash code
79 * @return string Hash code
81 public function getHashCode() {
82 return md5(
83 $this->getText()
84 . $this->_font->getHashCode()
85 . __CLASS__
89 /**
90 * Implement PHP __clone to create a deep clone, not just a shallow copy.
92 public function __clone() {
93 $vars = get_object_vars($this);
94 foreach ($vars as $key => $value) {
95 if (is_object($value)) {
96 $this->$key = clone $value;
97 } else {
98 $this->$key = $value;