21
21
* @category PHPExcel
22
22
* @package PHPExcel
23
23
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
24
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
24
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25
25
* @version ##VERSION##, ##DATE##
26
26
*/
27
27
35
35
*/
36
36
class PHPExcel_Comment implements PHPExcel_IComparable
37
37
{
38
- /**
39
- * Author
40
- *
41
- * @var string
42
- */
43
- private $ _author ;
38
+ /**
39
+ * Author
40
+ *
41
+ * @var string
42
+ */
43
+ private $ _author ;
44
44
45
- /**
46
- * Rich text comment
47
- *
48
- * @var PHPExcel_RichText
49
- */
50
- private $ _text ;
45
+ /**
46
+ * Rich text comment
47
+ *
48
+ * @var PHPExcel_RichText
49
+ */
50
+ private $ _text ;
51
51
52
- /**
53
- * Comment width (CSS style, i.e. XXpx or YYpt)
54
- *
55
- * @var string
56
- */
57
- private $ _width = '96pt ' ;
52
+ /**
53
+ * Comment width (CSS style, i.e. XXpx or YYpt)
54
+ *
55
+ * @var string
56
+ */
57
+ private $ _width = '96pt ' ;
58
58
59
- /**
60
- * Left margin (CSS style, i.e. XXpx or YYpt)
61
- *
62
- * @var string
63
- */
64
- private $ _marginLeft = '59.25pt ' ;
59
+ /**
60
+ * Left margin (CSS style, i.e. XXpx or YYpt)
61
+ *
62
+ * @var string
63
+ */
64
+ private $ _marginLeft = '59.25pt ' ;
65
65
66
- /**
67
- * Top margin (CSS style, i.e. XXpx or YYpt)
68
- *
69
- * @var string
70
- */
71
- private $ _marginTop = '1.5pt ' ;
66
+ /**
67
+ * Top margin (CSS style, i.e. XXpx or YYpt)
68
+ *
69
+ * @var string
70
+ */
71
+ private $ _marginTop = '1.5pt ' ;
72
72
73
- /**
74
- * Visible
75
- *
76
- * @var boolean
77
- */
78
- private $ _visible = false ;
73
+ /**
74
+ * Visible
75
+ *
76
+ * @var boolean
77
+ */
78
+ private $ _visible = false ;
79
79
80
- /**
81
- * Comment height (CSS style, i.e. XXpx or YYpt)
82
- *
83
- * @var string
84
- */
85
- private $ _height = '55.5pt ' ;
80
+ /**
81
+ * Comment height (CSS style, i.e. XXpx or YYpt)
82
+ *
83
+ * @var string
84
+ */
85
+ private $ _height = '55.5pt ' ;
86
86
87
- /**
88
- * Comment fill color
89
- *
90
- * @var PHPExcel_Style_Color
91
- */
92
- private $ _fillColor ;
87
+ /**
88
+ * Comment fill color
89
+ *
90
+ * @var PHPExcel_Style_Color
91
+ */
92
+ private $ _fillColor ;
93
93
94
- /**
95
- * Alignment
96
- *
97
- * @var string
98
- */
99
- private $ _alignment ;
94
+ /**
95
+ * Alignment
96
+ *
97
+ * @var string
98
+ */
99
+ private $ _alignment ;
100
100
101
101
/**
102
102
* Create a new PHPExcel_Comment
@@ -105,11 +105,11 @@ class PHPExcel_Comment implements PHPExcel_IComparable
105
105
*/
106
106
public function __construct ()
107
107
{
108
- // Initialise variables
109
- $ this ->_author = 'Author ' ;
110
- $ this ->_text = new PHPExcel_RichText ();
111
- $ this ->_fillColor = new PHPExcel_Style_Color ('FFFFFFE1 ' );
112
- $ this ->_alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL ;
108
+ // Initialise variables
109
+ $ this ->_author = 'Author ' ;
110
+ $ this ->_text = new PHPExcel_RichText ();
111
+ $ this ->_fillColor = new PHPExcel_Style_Color ('FFFFFFE1 ' );
112
+ $ this ->_alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL ;
113
113
}
114
114
115
115
/**
@@ -118,7 +118,7 @@ public function __construct()
118
118
* @return string
119
119
*/
120
120
public function getAuthor () {
121
- return $ this ->_author ;
121
+ return $ this ->_author ;
122
122
}
123
123
124
124
/**
@@ -127,18 +127,18 @@ public function getAuthor() {
127
127
* @param string $pValue
128
128
* @return PHPExcel_Comment
129
129
*/
130
- public function setAuthor ($ pValue = '' ) {
131
- $ this ->_author = $ pValue ;
132
- return $ this ;
133
- }
130
+ public function setAuthor ($ pValue = '' ) {
131
+ $ this ->_author = $ pValue ;
132
+ return $ this ;
133
+ }
134
134
135
135
/**
136
136
* Get Rich text comment
137
137
*
138
138
* @return PHPExcel_RichText
139
139
*/
140
140
public function getText () {
141
- return $ this ->_text ;
141
+ return $ this ->_text ;
142
142
}
143
143
144
144
/**
@@ -148,8 +148,8 @@ public function getText() {
148
148
* @return PHPExcel_Comment
149
149
*/
150
150
public function setText (PHPExcel_RichText $ pValue ) {
151
- $ this ->_text = $ pValue ;
152
- return $ this ;
151
+ $ this ->_text = $ pValue ;
152
+ return $ this ;
153
153
}
154
154
155
155
/**
@@ -268,8 +268,8 @@ public function getFillColor() {
268
268
* @return PHPExcel_Comment
269
269
*/
270
270
public function setAlignment ($ pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL ) {
271
- $ this ->_alignment = $ pValue ;
272
- return $ this ;
271
+ $ this ->_alignment = $ pValue ;
272
+ return $ this ;
273
273
}
274
274
275
275
/**
@@ -278,40 +278,40 @@ public function setAlignment($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENE
278
278
* @return string
279
279
*/
280
280
public function getAlignment () {
281
- return $ this ->_alignment ;
281
+ return $ this ->_alignment ;
282
282
}
283
283
284
- /**
285
- * Get hash code
286
- *
287
- * @return string Hash code
288
- */
289
- public function getHashCode () {
290
- return md5 (
291
- $ this ->_author
292
- . $ this ->_text ->getHashCode ()
293
- . $ this ->_width
294
- . $ this ->_height
295
- . $ this ->_marginLeft
296
- . $ this ->_marginTop
297
- . ($ this ->_visible ? 1 : 0 )
298
- . $ this ->_fillColor ->getHashCode ()
299
- . $ this ->_alignment
300
- . __CLASS__
301
- );
284
+ /**
285
+ * Get hash code
286
+ *
287
+ * @return string Hash code
288
+ */
289
+ public function getHashCode () {
290
+ return md5 (
291
+ $ this ->_author
292
+ . $ this ->_text ->getHashCode ()
293
+ . $ this ->_width
294
+ . $ this ->_height
295
+ . $ this ->_marginLeft
296
+ . $ this ->_marginTop
297
+ . ($ this ->_visible ? 1 : 0 )
298
+ . $ this ->_fillColor ->getHashCode ()
299
+ . $ this ->_alignment
300
+ . __CLASS__
301
+ );
302
302
}
303
303
304
- /**
305
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
306
- */
307
- public function __clone () {
308
- $ vars = get_object_vars ($ this );
309
- foreach ($ vars as $ key => $ value ) {
310
- if (is_object ($ value )) {
311
- $ this ->$ key = clone $ value ;
312
- } else {
313
- $ this ->$ key = $ value ;
314
- }
315
- }
316
- }
304
+ /**
305
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
306
+ */
307
+ public function __clone () {
308
+ $ vars = get_object_vars ($ this );
309
+ foreach ($ vars as $ key => $ value ) {
310
+ if (is_object ($ value )) {
311
+ $ this ->$ key = clone $ value ;
312
+ } else {
313
+ $ this ->$ key = $ value ;
314
+ }
315
+ }
316
+ }
317
317
}
0 commit comments