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
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##
28 * PHPExcel_RichText_Run
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
39 * @var PHPExcel_Style_Font
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();
58 * @return PHPExcel_Style_Font
60 public function getFont() {
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;
79 * @return string Hash code
81 public function getHashCode() {
84 . $this->_font
->getHashCode()
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;