← All changes
|
vendor/phpoffice/phpexcel/Classes/PHPExcel/RichText.php
+22
-14
3.1.2
→
3.0.10
View file →
| @@ -1,10 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | - | |
| 3 | 2 | /** |
| 4 | - * PHPExcel_RichText | |
| 3 | + * PHPExcel | |
| 5 | 4 | * |
| 6 | - * Copyright (c) 2006 - 2015 PHPExcel | |
| 5 | + * Copyright (c) 2006 - 2014 PHPExcel | |
| 7 | 6 | * |
| 8 | 7 | * This library is free software; you can redistribute it and/or |
| 9 | 8 | * modify it under the terms of the GNU Lesser General Public |
| 10 | 9 | * License as published by the Free Software Foundation; either |
| @@ -20,12 +19,21 @@ | ||
| 20 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | 20 | * |
| 22 | 21 | * @category PHPExcel |
| 23 | 22 | * @package PHPExcel_RichText |
| 24 | - * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) | |
| 23 | + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) | |
| 25 | 24 | * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL |
| 26 | 25 | * @version ##VERSION##, ##DATE## |
| 27 | 26 | */ |
| 27 | + | |
| 28 | + | |
| 29 | +/** | |
| 30 | + * PHPExcel_RichText | |
| 31 | + * | |
| 32 | + * @category PHPExcel | |
| 33 | + * @package PHPExcel_RichText | |
| 34 | + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) | |
| 35 | + */ | |
| 28 | 36 | class PHPExcel_RichText implements PHPExcel_IComparable |
| 29 | 37 | { |
| 30 | 38 | /** |
| 31 | 39 | * Rich text elements |
| @@ -31,9 +39,9 @@ | ||
| 31 | 39 | * Rich text elements |
| 32 | 40 | * |
| 33 | 41 | * @var PHPExcel_RichText_ITextElement[] |
| 34 | 42 | */ |
| 35 | - private $richTextElements; | |
| 43 | + private $_richTextElements; | |
| 36 | 44 | |
| 37 | 45 | /** |
| 38 | 46 | * Create a new PHPExcel_RichText instance |
| 39 | 47 | * |
| @@ -42,12 +50,12 @@ | ||
| 42 | 50 | */ |
| 43 | 51 | public function __construct(PHPExcel_Cell $pCell = null) |
| 44 | 52 | { |
| 45 | 53 | // Initialise variables |
| 46 | - $this->richTextElements = array(); | |
| 54 | + $this->_richTextElements = array(); | |
| 47 | 55 | |
| 48 | 56 | // Rich-Text string attached to cell? |
| 49 | - if ($pCell !== null) { | |
| 57 | + if ($pCell !== NULL) { | |
| 50 | 58 | // Add cell text and style |
| 51 | 59 | if ($pCell->getValue() != "") { |
| 52 | 60 | $objRun = new PHPExcel_RichText_Run($pCell->getValue()); |
| 53 | 61 | $objRun->setFont(clone $pCell->getParent()->getStyle($pCell->getCoordinate())->getFont()); |
| @@ -67,9 +75,9 @@ | ||
| 67 | 75 | * @return PHPExcel_RichText |
| 68 | 76 | */ |
| 69 | 77 | public function addText(PHPExcel_RichText_ITextElement $pText = null) |
| 70 | 78 | { |
| 71 | - $this->richTextElements[] = $pText; | |
| 79 | + $this->_richTextElements[] = $pText; | |
| 72 | 80 | return $this; |
| 73 | 81 | } |
| 74 | 82 | |
| 75 | 83 | /** |
| @@ -110,9 +118,9 @@ | ||
| 110 | 118 | // Return value |
| 111 | 119 | $returnValue = ''; |
| 112 | 120 | |
| 113 | 121 | // Loop through all PHPExcel_RichText_ITextElement |
| 114 | - foreach ($this->richTextElements as $text) { | |
| 122 | + foreach ($this->_richTextElements as $text) { | |
| 115 | 123 | $returnValue .= $text->getText(); |
| 116 | 124 | } |
| 117 | 125 | |
| 118 | 126 | // Return |
| @@ -135,9 +143,9 @@ | ||
| 135 | 143 | * @return PHPExcel_RichText_ITextElement[] |
| 136 | 144 | */ |
| 137 | 145 | public function getRichTextElements() |
| 138 | 146 | { |
| 139 | - return $this->richTextElements; | |
| 147 | + return $this->_richTextElements; | |
| 140 | 148 | } |
| 141 | 149 | |
| 142 | 150 | /** |
| 143 | 151 | * Set Rich Text elements |
| @@ -148,9 +156,9 @@ | ||
| 148 | 156 | */ |
| 149 | 157 | public function setRichTextElements($pElements = null) |
| 150 | 158 | { |
| 151 | 159 | if (is_array($pElements)) { |
| 152 | - $this->richTextElements = $pElements; | |
| 160 | + $this->_richTextElements = $pElements; | |
| 153 | 161 | } else { |
| 154 | 162 | throw new PHPExcel_Exception("Invalid PHPExcel_RichText_ITextElement[] array passed."); |
| 155 | 163 | } |
| 156 | 164 | return $this; |
| @@ -163,15 +171,15 @@ | ||
| 163 | 171 | */ |
| 164 | 172 | public function getHashCode() |
| 165 | 173 | { |
| 166 | 174 | $hashElements = ''; |
| 167 | - foreach ($this->richTextElements as $element) { | |
| 175 | + foreach ($this->_richTextElements as $element) { | |
| 168 | 176 | $hashElements .= $element->getHashCode(); |
| 169 | 177 | } |
| 170 | 178 | |
| 171 | 179 | return md5( |
| 172 | - $hashElements . | |
| 173 | - __CLASS__ | |
| 180 | + $hashElements | |
| 181 | + . __CLASS__ | |
| 174 | 182 | ); |
| 175 | 183 | } |
| 176 | 184 | |
| 177 | 185 | /** |