30 if (!defined(
'PHPEXCEL_ROOT')) {
34 define(
'PHPEXCEL_ROOT', dirname(__FILE__) .
'/../../');
38 require_once PHPEXCEL_ROOT .
'PHPExcel/IComparable.php';
133 $this->_isSupervisor = $isSupervisor;
138 $this->_textRotation = 0;
139 $this->_wrapText =
false;
140 $this->_shrinkToFit =
false;
152 $this->_parent = $parent;
174 return $this->_parent->getSharedComponent()->getAlignment();
184 return $this->_parent->getActiveSheet();
217 return array(
'alignment' => $array);
239 if (is_array($pStyles)) {
240 if ($this->_isSupervisor) {
243 if (array_key_exists(
'horizontal', $pStyles)) {
246 if (array_key_exists(
'vertical', $pStyles)) {
249 if (array_key_exists(
'rotation', $pStyles)) {
252 if (array_key_exists(
'wrap', $pStyles)) {
255 if (array_key_exists(
'shrinkToFit', $pStyles)) {
258 if (array_key_exists(
'indent', $pStyles)) {
263 throw new Exception(
"Invalid style array passed.");
274 if ($this->_isSupervisor) {
291 if ($this->_isSupervisor) {
292 $styleArray = $this->
getStyleArray(array(
'horizontal' => $pValue));
296 $this->_horizontal = $pValue;
307 if ($this->_isSupervisor) {
324 if ($this->_isSupervisor) {
325 $styleArray = $this->
getStyleArray(array(
'vertical' => $pValue));
328 $this->_vertical = $pValue;
339 if ($this->_isSupervisor) {
354 if ($pValue == 255) {
359 if ( ($pValue >= -90 && $pValue <= 90) || $pValue == -165 ) {
360 if ($this->_isSupervisor) {
361 $styleArray = $this->
getStyleArray(array(
'rotation' => $pValue));
364 $this->_textRotation = $pValue;
367 throw new Exception(
"Text rotation should be a value between -90 and 90.");
379 if ($this->_isSupervisor) {
395 if ($this->_isSupervisor) {
396 $styleArray = $this->
getStyleArray(array(
'wrap' => $pValue));
399 $this->_wrapText = $pValue;
410 if ($this->_isSupervisor) {
426 if ($this->_isSupervisor) {
427 $styleArray = $this->
getStyleArray(array(
'shrinkToFit' => $pValue));
430 $this->_shrinkToFit = $pValue;
441 if ($this->_isSupervisor) {
459 if ($this->_isSupervisor) {
460 $styleArray = $this->
getStyleArray(array(
'indent' => $pValue));
463 $this->_indent = $pValue;
474 if ($this->_isSupervisor) {
480 . $this->_textRotation
481 . ($this->_wrapText ?
't' :
'f')
482 . ($this->_shrinkToFit ?
't' :
'f')
516 $this->_hashIndex = $value;
523 $vars = get_object_vars($this);
524 foreach ($vars as
$key => $value) {
525 if (is_object($value)) {
526 $this->
$key = clone $value;
528 $this->
$key = $value;